<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables, BangPatterns #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns   #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-comment">{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

Renaming and dependency analysis of bindings

This module does renaming and dependency analysis on value bindings in
the abstract syntax.  It does {\em not} do cycle-checks on class or
type-synonym declarations; those cannot be done at this stage because
they may be affected by renaming (which isn't fully worked out yet).
-}</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Rename.Bind</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-19"></span><span>   </span><span class="hs-comment">-- Renaming top-level bindings</span><span>
</span><span id="line-20"></span><span>   </span><span class="annot"><a href="GHC.Rename.Bind.html#rnTopBindsLHS"><span class="hs-identifier">rnTopBindsLHS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnTopBindsBoot"><span class="hs-identifier">rnTopBindsBoot</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnValBindsRHS"><span class="hs-identifier">rnValBindsRHS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>   </span><span class="hs-comment">-- Renaming local bindings</span><span>
</span><span id="line-23"></span><span>   </span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier">rnLocalBindsAndThen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsLHS"><span class="hs-identifier">rnLocalValBindsLHS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsRHS"><span class="hs-identifier">rnLocalValBindsRHS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>   </span><span class="hs-comment">-- Other bindings</span><span>
</span><span id="line-26"></span><span>   </span><span class="annot"><a href="GHC.Rename.Bind.html#rnMethodBinds"><span class="hs-identifier">rnMethodBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier">renameSigs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>   </span><span class="annot"><a href="GHC.Rename.Bind.html#rnMatchGroup"><span class="hs-identifier">rnMatchGroup</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnGRHSs"><span class="hs-identifier">rnGRHSs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnGRHS"><span class="hs-identifier">rnGRHS</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Bind.html#rnSrcFixityDecl"><span class="hs-identifier">rnSrcFixityDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>   </span><span class="annot"><a href="GHC.Rename.Bind.html#makeMiniFixityEnv"><span class="hs-identifier">makeMiniFixityEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier">MiniFixityEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>   </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier">HsSigCtxt</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>   </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Rename.Expr.html"><span class="hs-identifier">GHC.Rename.Expr</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier">rnLExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Expr.html#rnStmts"><span class="hs-identifier">rnStmts</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.HsType.html"><span class="hs-identifier">GHC.Rename.HsType</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Pat.html"><span class="hs-identifier">GHC.Rename.Pat</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Names.html"><span class="hs-identifier">GHC.Rename.Names</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html"><span class="hs-identifier">GHC.Rename.Env</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html"><span class="hs-identifier">GHC.Rename.Fixity</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html"><span class="hs-identifier">GHC.Rename.Utils</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier">HsDocContext</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier">mapFvRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#extendTyVarEnvFVRn"><span class="hs-identifier">extendTyVarEnvFVRn</span></a></span><span>
</span><span id="line-44"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier">checkDupRdrNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#warnUnusedLocalBinds"><span class="hs-identifier">warnUnusedLocalBinds</span></a></span><span>
</span><span id="line-45"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier">checkUnusedRecordWildcard</span></a></span><span>
</span><span id="line-46"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkDupAndShadowedNames"><span class="hs-identifier">checkDupAndShadowedNames</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier">bindLocalNamesFV</span></a></span><span>
</span><span id="line-47"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#addNoNestedForallsContextsErr"><span class="hs-identifier">addNoNestedForallsContextsErr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier">checkInferredVars</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Env.html"><span class="hs-identifier">GHC.Types.Name.Env</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier">rdrNameOcc</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html"><span class="hs-identifier">GHC.Data.List.SetOps</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.List.SetOps.html#findDupsEq"><span class="hs-identifier">findDupsEq</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>         </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier">RecFlag</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TypeOrKind"><span class="hs-identifier">TypeOrKind</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html"><span class="hs-identifier">GHC.Data.Graph.Directed</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../containers/src/Data.Graph.html#SCC"><span class="hs-identifier">SCC</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>          </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html#orElse"><span class="hs-identifier">orElse</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-65"></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#toList"><span class="hs-identifier">toList</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>          </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier">partition</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier">sortBy</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier">NonEmpty</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="hs-comment">{-
-- ToDo: Put the annotations into the monad, so that they arrive in the proper
-- place and can be used when complaining.

The code tree received by the function @rnBinds@ contains definitions
in where-clauses which are all apparently mutually recursive, but which may
not really depend upon each other. For example, in the top level program
\begin{verbatim}
f x = y where a = x
              y = x
\end{verbatim}
the definitions of @a@ and @y@ do not depend on each other at all.
Unfortunately, the typechecker cannot always check such definitions.
\footnote{Mycroft, A. 1984. Polymorphic type schemes and recursive
definitions. In Proceedings of the International Symposium on Programming,
Toulouse, pp. 217-39. LNCS 167. Springer Verlag.}
However, the typechecker usually can check definitions in which only the
strongly connected components have been collected into recursive bindings.
This is precisely what the function @rnBinds@ does.

ToDo: deal with case where a single monobinds binds the same variable
twice.

The vertag tag is a unique @Int@; the tags only need to be unique
within one @MonoBinds@, so that unique-Int plumbing is done explicitly
(heavy monad machinery not needed).


************************************************************************
*                                                                      *
* naming conventions                                                   *
*                                                                      *
************************************************************************

\subsection[name-conventions]{Name conventions}

The basic algorithm involves walking over the tree and returning a tuple
containing the new tree plus its free variables. Some functions, such
as those walking polymorphic bindings (HsBinds) and qualifier lists in
list comprehensions (@Quals@), return the variables bound in local
environments. These are then used to calculate the free variables of the
expression evaluated in these environments.

Conventions for variable names are as follows:
\begin{itemize}
\item
new code is given a prime to distinguish it from the old.

\item
a set of variables defined in @Exp@ is written @dvExp@

\item
a set of variables free in @Exp@ is written @fvExp@
\end{itemize}

************************************************************************
*                                                                      *
* analysing polymorphic bindings (HsBindGroup, HsBind)
*                                                                      *
************************************************************************

\subsubsection[dep-HsBinds]{Polymorphic bindings}

Non-recursive expressions are reconstructed without any changes at top
level, although their component expressions may have to be altered.
However, non-recursive expressions are currently not expected as
\Haskell{} programs, and this code should not be executed.

Monomorphic bindings contain information that is returned in a tuple
(a @FlatMonoBinds@) containing:

\begin{enumerate}
\item
a unique @Int@ that serves as the ``vertex tag'' for this binding.

\item
the name of a function or the names in a pattern. These are a set
referred to as @dvLhs@, the defined variables of the left hand side.

\item
the free variables of the body. These are referred to as @fvBody@.

\item
the definition's actual code. This is referred to as just @code@.
\end{enumerate}

The function @nonRecDvFv@ returns two sets of variables. The first is
the set of variables defined in the set of monomorphic bindings, while the
second is the set of free variables in those bindings.

The set of variables defined in a non-recursive binding is just the
union of all of them, as @union@ removes duplicates. However, the
free variables in each successive set of cumulative bindings is the
union of those in the previous set plus those of the newest binding after
the defined variables of the previous set have been removed.

@rnMethodBinds@ deals only with the declarations in class and
instance declarations.  It expects only to see @FunMonoBind@s, and
it expects the global environment to contain bindings for the binders
(which are all class operations).

************************************************************************
*                                                                      *
\subsubsection{ Top-level bindings}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="hs-comment">-- for top-level bindings, we need to make top-level names,</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- so we have a different entry point than for local bindings</span><span>
</span><span id="line-181"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnTopBindsLHS"><span class="hs-identifier hs-type">rnTopBindsLHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span>
</span><span id="line-182"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-183"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span id="rnTopBindsLHS"><span class="annot"><span class="annottext">rnTopBindsLHS :: MiniFixityEnv -&gt; HsValBinds GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnTopBindsLHS"><span class="hs-identifier hs-var hs-var">rnTopBindsLHS</span></a></span></span><span> </span><span id="local-6989586621681134491"><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134491"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span> </span><span id="local-6989586621681134490"><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134490"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-185"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; HsValBinds GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnValBindsLHS"><span class="hs-identifier hs-var">rnValBindsLHS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MiniFixityEnv -&gt; NameMaker
</span><a href="GHC.Rename.Pat.html#topRecNameMaker"><span class="hs-identifier hs-var">topRecNameMaker</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134491"><span class="hs-identifier hs-var">fix_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134490"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnTopBindsBoot"><span class="hs-identifier hs-type">rnTopBindsBoot</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NameSet"><span class="hs-identifier hs-type">NameSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-188"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#DefUses"><span class="hs-identifier hs-type">DefUses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span class="hs-comment">-- A hs-boot file has no bindings.</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- Return a single HsBindGroup with empty binds and renamed signatures</span><span>
</span><span id="line-191"></span><span id="rnTopBindsBoot"><span class="annot"><span class="annottext">rnTopBindsBoot :: NameSet
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBinds GhcRn, DefUses)
</span><a href="GHC.Rename.Bind.html#rnTopBindsBoot"><span class="hs-identifier hs-var hs-var">rnTopBindsBoot</span></a></span></span><span> </span><span id="local-6989586621681134487"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134487"><span class="hs-identifier hs-var">bound_names</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-type">ValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XValBinds GhcRn GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134485"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134485"><span class="hs-identifier hs-var">mbinds</span></a></span></span><span> </span><span id="local-6989586621681134484"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134484"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#checkErr"><span class="hs-identifier hs-var">checkErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs -&gt; Bool
forall idL idR. LHsBindsLR idL idR -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isEmptyLHsBinds"><span class="hs-identifier hs-var">isEmptyLHsBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134485"><span class="hs-identifier hs-var">mbinds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#bindsInHsBootFile"><span class="hs-identifier hs-var">bindsInHsBootFile</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134485"><span class="hs-identifier hs-var">mbinds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134480"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134480"><span class="hs-identifier hs-var">sigs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134479"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134479"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-var">renameSigs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet -&gt; HsSigCtxt
</span><a href="GHC.Rename.Env.html#HsBootCtxt"><span class="hs-identifier hs-var">HsBootCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134487"><span class="hs-identifier hs-var">bound_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134484"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-194"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsValBinds GhcRn, DefUses) -&gt; RnM (HsValBinds GhcRn, DefUses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XXValBindsLR GhcRn GhcRn -&gt; HsValBinds GhcRn
forall idL idR. XXValBindsLR idL idR -&gt; HsValBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#XValBindsLR"><span class="hs-identifier hs-var">XValBindsLR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)] -&gt; [LSig GhcRn] -&gt; NHsValBindsLR GhcRn
forall idL.
[(RecFlag, LHsBinds idL)] -&gt; [LSig GhcRn] -&gt; NHsValBindsLR idL
</span><a href="GHC.Hs.Binds.html#NValBinds"><span class="hs-identifier hs-var">NValBinds</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134480"><span class="hs-identifier hs-var">sigs'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#usesOnly"><span class="hs-identifier hs-var">usesOnly</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134479"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-195"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnTopBindsBoot"><span class="hs-identifier hs-var">rnTopBindsBoot</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134474"><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134474"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; RnM (HsValBinds GhcRn, DefUses)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnTopBindsBoot&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134474"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="hs-comment">{-
*********************************************************
*                                                      *
                HsLocalBinds
*                                                      *
*********************************************************
-}</span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span id="local-6989586621681135095"><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier hs-type">rnLocalBindsAndThen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsLocalBinds"><span class="hs-identifier hs-type">HsLocalBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-206"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsLocalBinds"><span class="hs-identifier hs-type">HsLocalBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681135095"><span class="hs-identifier hs-type">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681135095"><span class="hs-identifier hs-type">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-208"></span><span class="hs-comment">-- This version (a) assumes that the binding vars are *not* already in scope</span><span>
</span><span id="line-209"></span><span class="hs-comment">--               (b) removes the binders from the free vars of the thing inside</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- The parser doesn't produce ThenBinds</span><span>
</span><span id="line-211"></span><span id="rnLocalBindsAndThen"><span class="annot"><span class="annottext">rnLocalBindsAndThen :: forall result.
HsLocalBinds GhcPs
-&gt; (HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
</span><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier hs-var hs-var">rnLocalBindsAndThen</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#EmptyLocalBinds"><span class="hs-identifier hs-type">EmptyLocalBinds</span></a></span><span> </span><span id="local-6989586621681134466"><span class="annot"><span class="annottext">XEmptyLocalBinds GhcPs GhcPs
</span><a href="#local-6989586621681134466"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134465"><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134465"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-212"></span><span>  </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134465"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XEmptyLocalBinds GhcRn GhcRn -&gt; HsLocalBinds GhcRn
forall idL idR. XEmptyLocalBinds idL idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#EmptyLocalBinds"><span class="hs-identifier hs-var">EmptyLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XEmptyLocalBinds GhcPs GhcPs
XEmptyLocalBinds GhcRn GhcRn
</span><a href="#local-6989586621681134466"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyNameSet"><span class="hs-identifier hs-var">emptyNameSet</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier hs-var">rnLocalBindsAndThen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span id="local-6989586621681134462"><span class="annot"><span class="annottext">XHsValBinds GhcPs GhcPs
</span><a href="#local-6989586621681134462"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681134461"><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134461"><span class="hs-identifier hs-var">val_binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134460"><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134460"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
-&gt; (HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
forall result.
HsValBinds GhcPs
-&gt; (HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsAndThen"><span class="hs-identifier hs-var">rnLocalValBindsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134461"><span class="hs-identifier hs-var">val_binds</span></a></span><span> </span><span class="annot"><span class="annottext">((HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
 -&gt; RnM (result, NameSet))
-&gt; (HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681134458"><span class="annot"><span class="annottext">HsValBinds GhcRn
</span><a href="#local-6989586621681134458"><span class="hs-identifier hs-var">val_binds'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-216"></span><span>      </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134460"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsValBinds GhcRn GhcRn -&gt; HsValBinds GhcRn -&gt; HsLocalBinds GhcRn
forall idL idR.
XHsValBinds idL idR
-&gt; HsValBindsLR idL idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-var">HsValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XHsValBinds GhcPs GhcPs
XHsValBinds GhcRn GhcRn
</span><a href="#local-6989586621681134462"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn
</span><a href="#local-6989586621681134458"><span class="hs-identifier hs-var">val_binds'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>
</span><span id="line-218"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier hs-var">rnLocalBindsAndThen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsIPBinds"><span class="hs-identifier hs-type">HsIPBinds</span></a></span><span> </span><span id="local-6989586621681134456"><span class="annot"><span class="annottext">XHsIPBinds GhcPs GhcPs
</span><a href="#local-6989586621681134456"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681134455"><span class="annot"><span class="annottext">HsIPBinds GhcPs
</span><a href="#local-6989586621681134455"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134454"><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134454"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-219"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681134453"><span class="annot"><span class="annottext">HsIPBinds GhcRn
</span><a href="#local-6989586621681134453"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681134452"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134452"><span class="hs-identifier hs-var">fv_binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsIPBinds GhcPs -&gt; RnM (HsIPBinds GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#rnIPBinds"><span class="hs-identifier hs-var">rnIPBinds</span></a></span><span> </span><span class="annot"><span class="annottext">HsIPBinds GhcPs
</span><a href="#local-6989586621681134455"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-220"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681134450"><span class="annot"><span class="annottext">result
</span><a href="#local-6989586621681134450"><span class="hs-identifier hs-var">thing</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134449"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134449"><span class="hs-identifier hs-var">fvs_thing</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134454"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XHsIPBinds GhcRn GhcRn -&gt; HsIPBinds GhcRn -&gt; HsLocalBinds GhcRn
forall idL idR.
XHsIPBinds idL idR -&gt; HsIPBinds idR -&gt; HsLocalBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#HsIPBinds"><span class="hs-identifier hs-var">HsIPBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XHsIPBinds GhcPs GhcPs
XHsIPBinds GhcRn GhcRn
</span><a href="#local-6989586621681134456"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">HsIPBinds GhcRn
</span><a href="#local-6989586621681134453"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134452"><span class="hs-identifier hs-var">fv_binds</span></a></span><span>
</span><span id="line-221"></span><span>    </span><span class="annot"><span class="annottext">(result, NameSet) -&gt; RnM (result, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">result
</span><a href="#local-6989586621681134450"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134449"><span class="hs-identifier hs-var">fvs_thing</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134452"><span class="hs-identifier hs-var">fv_binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnIPBinds"><span class="hs-identifier hs-type">rnIPBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsIPBinds"><span class="hs-identifier hs-type">HsIPBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsIPBinds"><span class="hs-identifier hs-type">HsIPBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-224"></span><span id="rnIPBinds"><span class="annot"><span class="annottext">rnIPBinds :: HsIPBinds GhcPs -&gt; RnM (HsIPBinds GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#rnIPBinds"><span class="hs-identifier hs-var hs-var">rnIPBinds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IPBinds"><span class="hs-identifier hs-type">IPBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XIPBinds GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134446"><span class="annot"><span class="annottext">[LIPBind GhcPs]
</span><a href="#local-6989586621681134446"><span class="hs-identifier hs-var">ip_binds</span></a></span></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-225"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681134445"><span class="annot"><span class="annottext">[Located (IPBind GhcRn)]
</span><a href="#local-6989586621681134445"><span class="hs-identifier hs-var">ip_binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134444"><span class="annot"><span class="annottext">[NameSet]
</span><a href="#local-6989586621681134444"><span class="hs-identifier hs-var">fvs_s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LIPBind GhcPs
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (Located (IPBind GhcRn), NameSet))
-&gt; [LIPBind GhcPs]
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) ([Located (IPBind GhcRn)], [NameSet])
forall (m :: * -&gt; *) a b c.
Applicative m =&gt;
(a -&gt; m (b, c)) -&gt; [a] -&gt; m ([b], [c])
</span><a href="../../base/src/Control.Monad.html#mapAndUnzipM"><span class="hs-identifier hs-var">mapAndUnzipM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(IPBind GhcPs -&gt; TcM (IPBind GhcRn, NameSet))
-&gt; LIPBind GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Located (IPBind GhcRn), NameSet)
forall a b c. (a -&gt; TcM (b, c)) -&gt; Located a -&gt; TcM (Located b, c)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocFstM"><span class="hs-identifier hs-var">wrapLocFstM</span></a></span><span> </span><span class="annot"><span class="annottext">IPBind GhcPs -&gt; TcM (IPBind GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#rnIPBind"><span class="hs-identifier hs-var">rnIPBind</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LIPBind GhcPs]
</span><a href="#local-6989586621681134446"><span class="hs-identifier hs-var">ip_binds</span></a></span><span>
</span><span id="line-226"></span><span>    </span><span class="annot"><span class="annottext">(HsIPBinds GhcRn, NameSet) -&gt; RnM (HsIPBinds GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIPBinds GhcRn -&gt; [Located (IPBind GhcRn)] -&gt; HsIPBinds GhcRn
forall id. XIPBinds id -&gt; [LIPBind id] -&gt; HsIPBinds id
</span><a href="GHC.Hs.Binds.html#IPBinds"><span class="hs-identifier hs-var">IPBinds</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIPBinds GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (IPBind GhcRn)]
</span><a href="#local-6989586621681134445"><span class="hs-identifier hs-var">ip_binds'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[NameSet] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFVs"><span class="hs-identifier hs-var">plusFVs</span></a></span><span> </span><span class="annot"><span class="annottext">[NameSet]
</span><a href="#local-6989586621681134444"><span class="hs-identifier hs-var">fvs_s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnIPBind"><span class="hs-identifier hs-type">rnIPBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#IPBind"><span class="hs-identifier hs-type">IPBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IPBind"><span class="hs-identifier hs-type">IPBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-229"></span><span id="rnIPBind"><span class="annot"><span class="annottext">rnIPBind :: IPBind GhcPs -&gt; TcM (IPBind GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#rnIPBind"><span class="hs-identifier hs-var hs-var">rnIPBind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IPBind"><span class="hs-identifier hs-type">IPBind</span></a></span><span> </span><span class="annot"><span class="annottext">XCIPBind GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">~</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681134437"><span class="annot"><span class="annottext">Located HsIPName
</span><a href="#local-6989586621681134437"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134436"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681134436"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-230"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681134435"><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681134435"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681134434"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134434"><span class="hs-identifier hs-var">fvExpr</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681134436"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-231"></span><span>    </span><span class="annot"><span class="annottext">(IPBind GhcRn, NameSet) -&gt; TcM (IPBind GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCIPBind GhcRn
-&gt; Either (Located HsIPName) (IdP GhcRn)
-&gt; LHsExpr GhcRn
-&gt; IPBind GhcRn
forall id.
XCIPBind id
-&gt; Either (Located HsIPName) (IdP id) -&gt; LHsExpr id -&gt; IPBind id
</span><a href="GHC.Hs.Binds.html#IPBind"><span class="hs-identifier hs-var">IPBind</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCIPBind GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located HsIPName -&gt; Either (Located HsIPName) Name
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">Located HsIPName
</span><a href="#local-6989586621681134437"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcRn
</span><a href="#local-6989586621681134435"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134434"><span class="hs-identifier hs-var">fvExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-232"></span><span>
</span><span id="line-233"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                ValBinds
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-240"></span><span>
</span><span id="line-241"></span><span class="hs-comment">-- Renaming local binding groups</span><span>
</span><span id="line-242"></span><span class="hs-comment">-- Does duplicate/shadow check</span><span>
</span><span id="line-243"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsLHS"><span class="hs-identifier hs-type">rnLocalValBindsLHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span>
</span><span id="line-244"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-245"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span id="rnLocalValBindsLHS"><span class="annot"><span class="annottext">rnLocalValBindsLHS :: MiniFixityEnv
-&gt; HsValBinds GhcPs -&gt; RnM ([Name], HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsLHS"><span class="hs-identifier hs-var hs-var">rnLocalValBindsLHS</span></a></span></span><span> </span><span id="local-6989586621681134433"><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134433"><span class="hs-identifier hs-var">fix_env</span></a></span></span><span> </span><span id="local-6989586621681134432"><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134432"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-247"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134431"><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134431"><span class="hs-identifier hs-var">binds'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; HsValBinds GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnValBindsLHS"><span class="hs-identifier hs-var">rnValBindsLHS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MiniFixityEnv -&gt; NameMaker
</span><a href="GHC.Rename.Pat.html#localRecNameMaker"><span class="hs-identifier hs-var">localRecNameMaker</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134433"><span class="hs-identifier hs-var">fix_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134432"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span>         </span><span class="hs-comment">-- Check for duplicates and shadowing</span><span>
</span><span id="line-250"></span><span>         </span><span class="hs-comment">-- Must do this *after* renaming the patterns</span><span>
</span><span id="line-251"></span><span>         </span><span class="hs-comment">-- See Note [Collect binders only after renaming] in GHC.Hs.Utils</span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>         </span><span class="hs-comment">-- We need to check for dups here because we</span><span>
</span><span id="line-254"></span><span>         </span><span class="hs-comment">-- don't don't bind all of the variables from the ValBinds at once</span><span>
</span><span id="line-255"></span><span>         </span><span class="hs-comment">-- with bindLocatedLocals any more.</span><span>
</span><span id="line-256"></span><span>         </span><span class="hs-comment">--</span><span>
</span><span id="line-257"></span><span>         </span><span class="hs-comment">-- Note that we don't want to do this at the top level, since</span><span>
</span><span id="line-258"></span><span>         </span><span class="hs-comment">-- sorting out duplicates and shadowing there happens elsewhere.</span><span>
</span><span id="line-259"></span><span>         </span><span class="hs-comment">-- The behavior is even different. For example,</span><span>
</span><span id="line-260"></span><span>         </span><span class="hs-comment">--   import A(f)</span><span>
</span><span id="line-261"></span><span>         </span><span class="hs-comment">--   f = ...</span><span>
</span><span id="line-262"></span><span>         </span><span class="hs-comment">-- should not produce a shadowing warning (but it will produce</span><span>
</span><span id="line-263"></span><span>         </span><span class="hs-comment">-- an ambiguity warning if you use f), but</span><span>
</span><span id="line-264"></span><span>         </span><span class="hs-comment">--   import A(f)</span><span>
</span><span id="line-265"></span><span>         </span><span class="hs-comment">--   g = let f = ... in f</span><span>
</span><span id="line-266"></span><span>         </span><span class="hs-comment">-- should.</span><span>
</span><span id="line-267"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134429"><span class="annot"><span class="annottext">bound_names :: [IdP GhcRn]
</span><a href="#local-6989586621681134429"><span class="hs-identifier hs-var hs-var">bound_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs -&gt; [IdP GhcRn]
forall (idL :: Pass) (idR :: Pass).
CollectPass (GhcPass idL) =&gt;
HsValBindsLR (GhcPass idL) (GhcPass idR) -&gt; [IdP (GhcPass idL)]
</span><a href="GHC.Hs.Utils.html#collectHsValBinders"><span class="hs-identifier hs-var">collectHsValBinders</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134431"><span class="hs-identifier hs-var">binds'</span></a></span><span>
</span><span id="line-268"></span><span>             </span><span class="hs-comment">-- There should be only Ids, but if there are any bogus</span><span>
</span><span id="line-269"></span><span>             </span><span class="hs-comment">-- pattern synonyms, we'll collect them anyway, so that</span><span>
</span><span id="line-270"></span><span>             </span><span class="hs-comment">-- we don't generate subsequent out-of-scope messages</span><span>
</span><span id="line-271"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134427"><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681134427"><span class="hs-identifier hs-var">envs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn (GlobalRdrEnv, LocalRdrEnv)
</span><a href="GHC.Tc.Utils.Monad.html#getRdrEnvs"><span class="hs-identifier hs-var">getRdrEnvs</span></a></span><span>
</span><span id="line-272"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv) -&gt; [Name] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkDupAndShadowedNames"><span class="hs-identifier hs-var">checkDupAndShadowedNames</span></a></span><span> </span><span class="annot"><span class="annottext">(GlobalRdrEnv, LocalRdrEnv)
</span><a href="#local-6989586621681134427"><span class="hs-identifier hs-var">envs</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681134429"><span class="hs-identifier hs-var">bound_names</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([Name], HsValBindsLR GhcRn GhcPs)
-&gt; RnM ([Name], HsValBindsLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681134429"><span class="hs-identifier hs-var">bound_names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134431"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="hs-comment">-- renames the left-hand sides</span><span>
</span><span id="line-277"></span><span class="hs-comment">-- generic version used both at the top level and for local binds</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- does some error checking, but not what gets done elsewhere at the top level</span><span>
</span><span id="line-279"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnValBindsLHS"><span class="hs-identifier hs-type">rnValBindsLHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Pat.html#NameMaker"><span class="hs-identifier hs-type">NameMaker</span></a></span><span>
</span><span id="line-280"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-281"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span id="rnValBindsLHS"><span class="annot"><span class="annottext">rnValBindsLHS :: NameMaker -&gt; HsValBinds GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnValBindsLHS"><span class="hs-identifier hs-var hs-var">rnValBindsLHS</span></a></span></span><span> </span><span id="local-6989586621681134425"><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134425"><span class="hs-identifier hs-var">topP</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-type">ValBinds</span></a></span><span> </span><span id="local-6989586621681134424"><span class="annot"><span class="annottext">XValBinds GhcPs GhcPs
</span><a href="#local-6989586621681134424"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681134423"><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134423"><span class="hs-identifier hs-var">mbinds</span></a></span></span><span> </span><span id="local-6989586621681134422"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134422"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134421"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134421"><span class="hs-identifier hs-var">mbinds'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (HsBindLR GhcPs GhcPs)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv)
      (GenLocated SrcSpan (HsBindLR GhcRn GhcPs)))
-&gt; LHsBindsLR GhcPs GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall (m :: * -&gt; *) a b.
Monad m =&gt;
(a -&gt; m b) -&gt; Bag a -&gt; m (Bag b)
</span><a href="GHC.Data.Bag.html#mapBagM"><span class="hs-identifier hs-var">mapBagM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsBindLR GhcPs GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs))
-&gt; Located (HsBindLR GhcPs GhcPs)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (GenLocated SrcSpan (HsBindLR GhcRn GhcPs))
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameMaker
-&gt; MsgDoc -&gt; HsBindLR GhcPs GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-var">rnBindLHS</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134425"><span class="hs-identifier hs-var">topP</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681134417"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134423"><span class="hs-identifier hs-var">mbinds</span></a></span><span>
</span><span id="line-284"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs))
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBindsLR GhcRn GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XValBinds GhcRn GhcPs
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; [LSig GhcPs]
-&gt; HsValBindsLR GhcRn GhcPs
forall idL idR.
XValBinds idL idR
-&gt; LHsBindsLR idL idR -&gt; [LSig idR] -&gt; HsValBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-var">ValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XValBinds GhcPs GhcPs
XValBinds GhcRn GhcPs
</span><a href="#local-6989586621681134424"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134421"><span class="hs-identifier hs-var">mbinds'</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134422"><span class="hs-identifier hs-var">sigs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-286"></span><span>    </span><span id="local-6989586621681134416"><span class="annot"><span class="annottext">bndrs :: [IdP GhcPs]
</span><a href="#local-6989586621681134416"><span class="hs-identifier hs-var hs-var">bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs -&gt; [IdP GhcPs]
forall p idR. CollectPass p =&gt; LHsBindsLR p idR -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectHsBindsBinders"><span class="hs-identifier hs-var">collectHsBindsBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134423"><span class="hs-identifier hs-var">mbinds</span></a></span><span>
</span><span id="line-287"></span><span>    </span><span id="local-6989586621681134417"><span class="annot"><span class="annottext">doc :: MsgDoc
</span><a href="#local-6989586621681134417"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the binding group for:&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; MsgDoc) -&gt; [RdrName] -&gt; MsgDoc
forall a. (a -&gt; MsgDoc) -&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#pprWithCommas"><span class="hs-identifier hs-var">pprWithCommas</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[RdrName]
[IdP GhcPs]
</span><a href="#local-6989586621681134416"><span class="hs-identifier hs-var">bndrs</span></a></span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnValBindsLHS"><span class="hs-identifier hs-var">rnValBindsLHS</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134411"><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134411"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; RnM (HsValBindsLR GhcRn GhcPs)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnValBindsLHSFromDoc&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsValBinds GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134411"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span class="hs-comment">-- General version used both from the top-level and for local things</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- Assumes the LHS vars are in scope</span><span>
</span><span id="line-293"></span><span class="hs-comment">--</span><span>
</span><span id="line-294"></span><span class="hs-comment">-- Does not bind the local fixity declarations</span><span>
</span><span id="line-295"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnValBindsRHS"><span class="hs-identifier hs-type">rnValBindsRHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier hs-type">HsSigCtxt</span></a></span><span>
</span><span id="line-296"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-297"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#DefUses"><span class="hs-identifier hs-type">DefUses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span id="rnValBindsRHS"><span class="annot"><span class="annottext">rnValBindsRHS :: HsSigCtxt
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBinds GhcRn, DefUses)
</span><a href="GHC.Rename.Bind.html#rnValBindsRHS"><span class="hs-identifier hs-var hs-var">rnValBindsRHS</span></a></span></span><span> </span><span id="local-6989586621681134410"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134410"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-type">ValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XValBinds GhcRn GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134409"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134409"><span class="hs-identifier hs-var">mbinds</span></a></span></span><span> </span><span id="local-6989586621681134408"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134408"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134407"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134407"><span class="hs-identifier hs-var">sigs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134406"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134406"><span class="hs-identifier hs-var">sig_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-var">renameSigs</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134410"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134408"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-301"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134405"><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134405"><span class="hs-identifier hs-var">binds_w_dus</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet))
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (Bag (LHsBind GhcRn, [Name], NameSet))
forall (m :: * -&gt; *) a b.
Monad m =&gt;
(a -&gt; m b) -&gt; Bag a -&gt; m (Bag b)
</span><a href="GHC.Data.Bag.html#mapBagM"><span class="hs-identifier hs-var">mapBagM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; [Name])
-&gt; GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnLBind"><span class="hs-identifier hs-var">rnLBind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LSig GhcRn] -&gt; Name -&gt; [Name]
</span><a href="GHC.Rename.Bind.html#mkScopedTvFn"><span class="hs-identifier hs-var">mkScopedTvFn</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134407"><span class="hs-identifier hs-var">sigs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134409"><span class="hs-identifier hs-var">mbinds</span></a></span><span>
</span><span id="line-302"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span id="local-6989586621681134402"><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)]
</span><a href="#local-6989586621681134402"><span class="hs-identifier hs-var">anal_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134401"><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134401"><span class="hs-identifier hs-var">anal_dus</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
-&gt; ([(RecFlag, LHsBinds GhcRn)], DefUses)
</span><a href="GHC.Rename.Bind.html#depAnalBinds"><span class="hs-identifier hs-var">depAnalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134405"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134399"><span class="annot"><span class="annottext">patsyn_fvs :: NameSet
</span><a href="#local-6989586621681134399"><span class="hs-identifier hs-var hs-var">patsyn_fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(PatSynBind GhcRn GhcRn -&gt; NameSet -&gt; NameSet)
-&gt; NameSet -&gt; [PatSynBind GhcRn GhcRn] -&gt; NameSet
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#unionNameSet"><span class="hs-identifier hs-var">unionNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">(NameSet -&gt; NameSet -&gt; NameSet)
-&gt; (PatSynBind GhcRn GhcRn -&gt; NameSet)
-&gt; PatSynBind GhcRn GhcRn
-&gt; NameSet
-&gt; NameSet
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn -&gt; NameSet
forall idL idR. PatSynBind idL idR -&gt; XPSB idL idR
</span><a href="GHC.Hs.Binds.html#psb_ext"><span class="hs-identifier hs-var hs-var">psb_ext</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyNameSet"><span class="hs-identifier hs-var">emptyNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">([PatSynBind GhcRn GhcRn] -&gt; NameSet)
-&gt; [PatSynBind GhcRn GhcRn] -&gt; NameSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-305"></span><span>                          </span><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)] -&gt; [PatSynBind GhcRn GhcRn]
forall id. [(RecFlag, LHsBinds id)] -&gt; [PatSynBind id id]
</span><a href="GHC.Hs.Utils.html#getPatSynBinds"><span class="hs-identifier hs-var">getPatSynBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)]
</span><a href="#local-6989586621681134402"><span class="hs-identifier hs-var">anal_binds</span></a></span><span>
</span><span id="line-306"></span><span>                </span><span class="hs-comment">-- The uses in binds_w_dus for PatSynBinds do not include</span><span>
</span><span id="line-307"></span><span>                </span><span class="hs-comment">-- variables used in the patsyn builders; see</span><span>
</span><span id="line-308"></span><span>                </span><span class="hs-comment">-- Note [Pattern synonym builders don't yield dependencies]</span><span>
</span><span id="line-309"></span><span>                </span><span class="hs-comment">-- But psb_fvs /does/ include those builder fvs.  So we</span><span>
</span><span id="line-310"></span><span>                </span><span class="hs-comment">-- add them back in here to avoid bogus warnings about</span><span>
</span><span id="line-311"></span><span>                </span><span class="hs-comment">-- unused variables (#12548)</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>             </span><span id="local-6989586621681134393"><span class="annot"><span class="annottext">valbind'_dus :: DefUses
</span><a href="#local-6989586621681134393"><span class="hs-identifier hs-var hs-var">valbind'_dus</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134401"><span class="hs-identifier hs-var">anal_dus</span></a></span><span> </span><span class="annot"><span class="annottext">DefUses -&gt; DefUses -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#plusDU"><span class="hs-operator hs-var">`plusDU`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#usesOnly"><span class="hs-identifier hs-var">usesOnly</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134406"><span class="hs-identifier hs-var">sig_fvs</span></a></span><span>
</span><span id="line-314"></span><span>                                     </span><span class="annot"><span class="annottext">DefUses -&gt; DefUses -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#plusDU"><span class="hs-operator hs-var">`plusDU`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; DefUses
</span><a href="GHC.Types.Name.Set.html#usesOnly"><span class="hs-identifier hs-var">usesOnly</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134399"><span class="hs-identifier hs-var">patsyn_fvs</span></a></span><span>
</span><span id="line-315"></span><span>                            </span><span class="hs-comment">-- Put the sig uses *after* the bindings</span><span>
</span><span id="line-316"></span><span>                            </span><span class="hs-comment">-- so that the binders are removed from</span><span>
</span><span id="line-317"></span><span>                            </span><span class="hs-comment">-- the uses in the sigs</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsValBinds GhcRn, DefUses) -&gt; RnM (HsValBinds GhcRn, DefUses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XXValBindsLR GhcRn GhcRn -&gt; HsValBinds GhcRn
forall idL idR. XXValBindsLR idL idR -&gt; HsValBindsLR idL idR
</span><a href="GHC.Hs.Binds.html#XValBindsLR"><span class="hs-identifier hs-var">XValBindsLR</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)] -&gt; [LSig GhcRn] -&gt; NHsValBindsLR GhcRn
forall idL.
[(RecFlag, LHsBinds idL)] -&gt; [LSig GhcRn] -&gt; NHsValBindsLR idL
</span><a href="GHC.Hs.Binds.html#NValBinds"><span class="hs-identifier hs-var">NValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[(RecFlag, LHsBinds GhcRn)]
</span><a href="#local-6989586621681134402"><span class="hs-identifier hs-var">anal_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134407"><span class="hs-identifier hs-var">sigs'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134393"><span class="hs-identifier hs-var">valbind'_dus</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-320"></span><span>
</span><span id="line-321"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnValBindsRHS"><span class="hs-identifier hs-var">rnValBindsRHS</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134391"><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134391"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; RnM (HsValBinds GhcRn, DefUses)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnValBindsRHS&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134391"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span class="hs-comment">-- Wrapper for local binds</span><span>
</span><span id="line-324"></span><span class="hs-comment">--</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- The *client* of this function is responsible for checking for unused binders;</span><span>
</span><span id="line-326"></span><span class="hs-comment">-- it doesn't (and can't: we don't have the thing inside the binds) happen here</span><span>
</span><span id="line-327"></span><span class="hs-comment">--</span><span>
</span><span id="line-328"></span><span class="hs-comment">-- The client is also responsible for bringing the fixities into scope</span><span>
</span><span id="line-329"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsRHS"><span class="hs-identifier hs-type">rnLocalValBindsRHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#NameSet"><span class="hs-identifier hs-type">NameSet</span></a></span><span>  </span><span class="hs-comment">-- names bound by the LHSes</span><span>
</span><span id="line-330"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBindsLR"><span class="hs-identifier hs-type">HsValBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-331"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#DefUses"><span class="hs-identifier hs-type">DefUses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span id="rnLocalValBindsRHS"><span class="annot"><span class="annottext">rnLocalValBindsRHS :: NameSet
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBinds GhcRn, DefUses)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsRHS"><span class="hs-identifier hs-var hs-var">rnLocalValBindsRHS</span></a></span></span><span> </span><span id="local-6989586621681134390"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134390"><span class="hs-identifier hs-var">bound_names</span></a></span></span><span> </span><span id="local-6989586621681134389"><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134389"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBinds GhcRn, DefUses)
</span><a href="GHC.Rename.Bind.html#rnValBindsRHS"><span class="hs-identifier hs-var">rnValBindsRHS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet -&gt; HsSigCtxt
</span><a href="GHC.Rename.Env.html#LocalBindCtxt"><span class="hs-identifier hs-var">LocalBindCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134390"><span class="hs-identifier hs-var">bound_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134389"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span class="hs-comment">-- for local binds</span><span>
</span><span id="line-336"></span><span class="hs-comment">-- wrapper that does both the left- and right-hand sides</span><span>
</span><span id="line-337"></span><span class="hs-comment">--</span><span>
</span><span id="line-338"></span><span class="hs-comment">-- here there are no local fixity decls passed in;</span><span>
</span><span id="line-339"></span><span class="hs-comment">-- the local fixity decls come from the ValBinds sigs</span><span>
</span><span id="line-340"></span><span id="local-6989586621681135088"><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsAndThen"><span class="hs-identifier hs-type">rnLocalValBindsAndThen</span></a></span><span>
</span><span id="line-341"></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-342"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsValBinds"><span class="hs-identifier hs-type">HsValBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681135088"><span class="hs-identifier hs-type">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681135088"><span class="hs-identifier hs-type">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-344"></span><span id="rnLocalValBindsAndThen"><span class="annot"><span class="annottext">rnLocalValBindsAndThen :: forall result.
HsValBinds GhcPs
-&gt; (HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsAndThen"><span class="hs-identifier hs-var hs-var">rnLocalValBindsAndThen</span></a></span></span><span> </span><span id="local-6989586621681134374"><span class="annot"><span class="annottext">binds :: HsValBinds GhcPs
</span><a href="#local-6989586621681134374"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ValBinds"><span class="hs-identifier hs-type">ValBinds</span></a></span><span> </span><span class="annot"><span class="annottext">XValBinds GhcPs GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134373"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134373"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134372"><span class="annot"><span class="annottext">HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134372"><span class="hs-identifier hs-var">thing_inside</span></a></span></span><span>
</span><span id="line-345"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span>     </span><span class="hs-comment">-- (A) Create the local fixity environment</span><span>
</span><span id="line-346"></span><span>          </span><span id="local-6989586621681134371"><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134371"><span class="hs-identifier hs-var">new_fixities</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LFixitySig GhcPs] -&gt; RnM MiniFixityEnv
</span><a href="GHC.Rename.Bind.html#makeMiniFixityEnv"><span class="hs-identifier hs-var">makeMiniFixityEnv</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; FixitySig GhcPs -&gt; LFixitySig GhcPs
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134369"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">FixitySig GhcPs
</span><a href="#local-6989586621681134368"><span class="hs-identifier hs-var">sig</span></a></span><span>
</span><span id="line-347"></span><span>                                            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134369"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134369"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134368"><span class="annot"><span class="annottext">FixitySig GhcPs
</span><a href="#local-6989586621681134368"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134373"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span>              </span><span class="hs-comment">-- (B) Rename the LHSes</span><span>
</span><span id="line-350"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134366"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134366"><span class="hs-identifier hs-var">bound_names</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134365"><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134365"><span class="hs-identifier hs-var">new_lhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
-&gt; HsValBinds GhcPs -&gt; RnM ([Name], HsValBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsLHS"><span class="hs-identifier hs-var">rnLocalValBindsLHS</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134371"><span class="hs-identifier hs-var">new_fixities</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134374"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-351"></span><span>
</span><span id="line-352"></span><span>              </span><span class="hs-comment">--     ...and bring them (and their fixities) into scope</span><span>
</span><span id="line-353"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; RnM (result, NameSet) -&gt; RnM (result, NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.Utils.html#bindLocalNamesFV"><span class="hs-identifier hs-var">bindLocalNamesFV</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134366"><span class="hs-identifier hs-var">bound_names</span></a></span><span>              </span><span class="annot"><span class="annottext">(RnM (result, NameSet) -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet) -&gt; RnM (result, NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-354"></span><span>          </span><span class="annot"><span class="annottext">MiniFixityEnv
-&gt; [Name] -&gt; RnM (result, NameSet) -&gt; RnM (result, NameSet)
forall a. MiniFixityEnv -&gt; [Name] -&gt; RnM a -&gt; RnM a
</span><a href="GHC.Rename.Fixity.html#addLocalFixities"><span class="hs-identifier hs-var">addLocalFixities</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134371"><span class="hs-identifier hs-var">new_fixities</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134366"><span class="hs-identifier hs-var">bound_names</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM (result, NameSet) -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet) -&gt; RnM (result, NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span>        </span><span class="hs-special">{</span><span>      </span><span class="hs-comment">-- (C) Do the RHS and thing inside</span><span>
</span><span id="line-357"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681134363"><span class="annot"><span class="annottext">HsValBinds GhcRn
</span><a href="#local-6989586621681134363"><span class="hs-identifier hs-var">binds'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134362"><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134362"><span class="hs-identifier hs-var">dus</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameSet
-&gt; HsValBindsLR GhcRn GhcPs -&gt; RnM (HsValBinds GhcRn, DefUses)
</span><a href="GHC.Rename.Bind.html#rnLocalValBindsRHS"><span class="hs-identifier hs-var">rnLocalValBindsRHS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134366"><span class="hs-identifier hs-var">bound_names</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">HsValBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134365"><span class="hs-identifier hs-var">new_lhs</span></a></span><span>
</span><span id="line-358"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134360"><span class="annot"><span class="annottext">result
</span><a href="#local-6989586621681134360"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134359"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134359"><span class="hs-identifier hs-var">result_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><a href="#local-6989586621681134372"><span class="hs-identifier hs-var">thing_inside</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn
</span><a href="#local-6989586621681134363"><span class="hs-identifier hs-var">binds'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUses -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#allUses"><span class="hs-identifier hs-var">allUses</span></a></span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134362"><span class="hs-identifier hs-var">dus</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span>                </span><span class="hs-comment">-- Report unused bindings based on the (accurate)</span><span>
</span><span id="line-361"></span><span>                </span><span class="hs-comment">-- findUses.  E.g.</span><span>
</span><span id="line-362"></span><span>                </span><span class="hs-comment">--      let x = x in 3</span><span>
</span><span id="line-363"></span><span>                </span><span class="hs-comment">-- should report 'x' unused</span><span>
</span><span id="line-364"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134357"><span class="annot"><span class="annottext">real_uses :: NameSet
</span><a href="#local-6989586621681134357"><span class="hs-identifier hs-var hs-var">real_uses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUses -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#findUses"><span class="hs-identifier hs-var">findUses</span></a></span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134362"><span class="hs-identifier hs-var">dus</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134359"><span class="hs-identifier hs-var">result_fvs</span></a></span><span>
</span><span id="line-365"></span><span>              </span><span class="hs-comment">-- Insert fake uses for variables introduced implicitly by</span><span>
</span><span id="line-366"></span><span>              </span><span class="hs-comment">-- wildcards (#4404)</span><span>
</span><span id="line-367"></span><span>              </span><span id="local-6989586621681134355"><span class="annot"><span class="annottext">rec_uses :: [(SrcSpan, [Name])]
</span><a href="#local-6989586621681134355"><span class="hs-identifier hs-var hs-var">rec_uses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn -&gt; [(SrcSpan, [Name])]
forall (idR :: Pass).
HsValBindsLR GhcRn (GhcPass idR) -&gt; [(SrcSpan, [Name])]
</span><a href="GHC.Hs.Utils.html#hsValBindsImplicits"><span class="hs-identifier hs-var">hsValBindsImplicits</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn
</span><a href="#local-6989586621681134363"><span class="hs-identifier hs-var">binds'</span></a></span><span>
</span><span id="line-368"></span><span>              </span><span id="local-6989586621681134353"><span class="annot"><span class="annottext">implicit_uses :: NameSet
</span><a href="#local-6989586621681134353"><span class="hs-identifier hs-var hs-var">implicit_uses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">([Name] -&gt; NameSet) -&gt; [Name] -&gt; NameSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((SrcSpan, [Name]) -&gt; [Name]) -&gt; [(SrcSpan, [Name])] -&gt; [Name]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan, [Name]) -&gt; [Name]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span>
</span><span id="line-369"></span><span>                                        </span><span class="annot"><span class="annottext">([(SrcSpan, [Name])] -&gt; [Name]) -&gt; [(SrcSpan, [Name])] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[(SrcSpan, [Name])]
</span><a href="#local-6989586621681134355"><span class="hs-identifier hs-var">rec_uses</span></a></span><span>
</span><span id="line-370"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((SrcSpan, [Name]) -&gt; TcRn ()) -&gt; [(SrcSpan, [Name])] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681134350"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134350"><span class="hs-identifier hs-var">loc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134349"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134349"><span class="hs-identifier hs-var">ns</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-371"></span><span>                    </span><span class="annot"><span class="annottext">SrcSpan -&gt; NameSet -&gt; Maybe [Name] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkUnusedRecordWildcard"><span class="hs-identifier hs-var">checkUnusedRecordWildcard</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134350"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134357"><span class="hs-identifier hs-var">real_uses</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Maybe [Name]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134349"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>                </span><span class="annot"><span class="annottext">[(SrcSpan, [Name])]
</span><a href="#local-6989586621681134355"><span class="hs-identifier hs-var">rec_uses</span></a></span><span>
</span><span id="line-373"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#warnUnusedLocalBinds"><span class="hs-identifier hs-var">warnUnusedLocalBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134366"><span class="hs-identifier hs-var">bound_names</span></a></span><span>
</span><span id="line-374"></span><span>                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134357"><span class="hs-identifier hs-var">real_uses</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#unionNameSet"><span class="hs-operator hs-var">`unionNameSet`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134353"><span class="hs-identifier hs-var">implicit_uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-377"></span><span>            </span><span class="hs-comment">-- The variables &quot;used&quot; in the val binds are:</span><span>
</span><span id="line-378"></span><span>            </span><span class="hs-comment">--   (1) the uses of the binds (allUses)</span><span>
</span><span id="line-379"></span><span>            </span><span class="hs-comment">--   (2) the FVs of the thing-inside</span><span>
</span><span id="line-380"></span><span>            </span><span id="local-6989586621681134348"><span class="annot"><span class="annottext">all_uses :: NameSet
</span><a href="#local-6989586621681134348"><span class="hs-identifier hs-var hs-var">all_uses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUses -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#allUses"><span class="hs-identifier hs-var">allUses</span></a></span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="#local-6989586621681134362"><span class="hs-identifier hs-var">dus</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134359"><span class="hs-identifier hs-var">result_fvs</span></a></span><span>
</span><span id="line-381"></span><span>                </span><span class="hs-comment">-- Note [Unused binding hack]</span><span>
</span><span id="line-382"></span><span>                </span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-383"></span><span>                </span><span class="hs-comment">-- Note that *in contrast* to the above reporting of</span><span>
</span><span id="line-384"></span><span>                </span><span class="hs-comment">-- unused bindings, (1) above uses duUses to return *all*</span><span>
</span><span id="line-385"></span><span>                </span><span class="hs-comment">-- the uses, even if the binding is unused.  Otherwise consider:</span><span>
</span><span id="line-386"></span><span>                </span><span class="hs-comment">--      x = 3</span><span>
</span><span id="line-387"></span><span>                </span><span class="hs-comment">--      y = let p = x in 'x'    -- NB: p not used</span><span>
</span><span id="line-388"></span><span>                </span><span class="hs-comment">-- If we don't &quot;see&quot; the dependency of 'y' on 'x', we may put the</span><span>
</span><span id="line-389"></span><span>                </span><span class="hs-comment">-- bindings in the wrong order, and the type checker will complain</span><span>
</span><span id="line-390"></span><span>                </span><span class="hs-comment">-- that x isn't in scope</span><span>
</span><span id="line-391"></span><span>                </span><span class="hs-comment">--</span><span>
</span><span id="line-392"></span><span>                </span><span class="hs-comment">-- But note that this means we won't report 'x' as unused,</span><span>
</span><span id="line-393"></span><span>                </span><span class="hs-comment">-- whereas we would if we had { x = 3; p = x; y = 'x' }</span><span>
</span><span id="line-394"></span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(result, NameSet) -&gt; RnM (result, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">result
</span><a href="#local-6989586621681134360"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134348"><span class="hs-identifier hs-var">all_uses</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-396"></span><span>                </span><span class="hs-comment">-- The bound names are pruned out of all_uses</span><span>
</span><span id="line-397"></span><span>                </span><span class="hs-comment">-- by the bindLocalNamesFV call above</span><span>
</span><span id="line-398"></span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLocalValBindsAndThen"><span class="hs-identifier hs-var">rnLocalValBindsAndThen</span></a></span><span> </span><span id="local-6989586621681134347"><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134347"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; RnM (result, NameSet)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnLocalValBindsAndThen&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsValBinds GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsValBinds GhcPs
</span><a href="#local-6989586621681134347"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>
</span><span id="line-402"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-403"></span><span>
</span><span id="line-404"></span><span class="hs-comment">-- renaming a single bind</span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-type">rnBindLHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Pat.html#NameMaker"><span class="hs-identifier hs-type">NameMaker</span></a></span><span>
</span><span id="line-407"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-408"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsBind"><span class="hs-identifier hs-type">HsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-409"></span><span>          </span><span class="hs-comment">-- returns the renamed left-hand side,</span><span>
</span><span id="line-410"></span><span>          </span><span class="hs-comment">-- and the FreeVars *of the LHS*</span><span>
</span><span id="line-411"></span><span>          </span><span class="hs-comment">-- (i.e., any free variables of the pattern)</span><span>
</span><span id="line-412"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsBindLR"><span class="hs-identifier hs-type">HsBindLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span>
</span><span id="line-414"></span><span id="rnBindLHS"><span class="annot"><span class="annottext">rnBindLHS :: NameMaker
-&gt; MsgDoc -&gt; HsBindLR GhcPs GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-var hs-var">rnBindLHS</span></a></span></span><span> </span><span id="local-6989586621681134345"><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134345"><span class="hs-identifier hs-var">name_maker</span></a></span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134344"><span class="annot"><span class="annottext">bind :: HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134344"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatBind"><span class="hs-identifier hs-type">PatBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_lhs :: forall idL idR. HsBindLR idL idR -&gt; LPat idL
</span><a href="GHC.Hs.Binds.html#pat_lhs"><span class="hs-identifier hs-var">pat_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134341"><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681134341"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-416"></span><span>      </span><span class="hs-comment">-- we don't actually use the FV processing of rnPatsAndThen here</span><span>
</span><span id="line-417"></span><span>      </span><span class="hs-special">(</span><span id="local-6989586621681134340"><span class="annot"><span class="annottext">Located (Pat GhcRn)
</span><a href="#local-6989586621681134340"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681134339"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134339"><span class="hs-identifier hs-var">pat'_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; LPat GhcPs -&gt; RnM (LPat GhcRn, NameSet)
</span><a href="GHC.Rename.Pat.html#rnBindPat"><span class="hs-identifier hs-var">rnBindPat</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134345"><span class="hs-identifier hs-var">name_maker</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681134341"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-418"></span><span>      </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134344"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_lhs :: LPat GhcRn
</span><a href="GHC.Hs.Binds.html#pat_lhs"><span class="hs-identifier hs-var">pat_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134340"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_ext :: XPatBind GhcRn GhcPs
</span><a href="GHC.Hs.Binds.html#pat_ext"><span class="hs-identifier hs-var">pat_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XPatBind GhcRn GhcPs
</span><a href="#local-6989586621681134339"><span class="hs-identifier hs-var">pat'_fvs</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>                </span><span class="hs-comment">-- We temporarily store the pat's FVs in bind_fvs;</span><span>
</span><span id="line-420"></span><span>                </span><span class="hs-comment">-- gets updated to the FVs of the whole bind</span><span>
</span><span id="line-421"></span><span>                </span><span class="hs-comment">-- when doing the RHS below</span><span>
</span><span id="line-422"></span><span>
</span><span id="line-423"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-var">rnBindLHS</span></a></span><span> </span><span id="local-6989586621681134336"><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134336"><span class="hs-identifier hs-var">name_maker</span></a></span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134335"><span class="annot"><span class="annottext">bind :: HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134335"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134332"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134332"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134331"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134331"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Pat.html#applyNameMaker"><span class="hs-identifier hs-var">applyNameMaker</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134336"><span class="hs-identifier hs-var">name_maker</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134332"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-425"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134335"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: Located (IdP GhcRn)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134331"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-426"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: XFunBind GhcRn GhcPs
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XFunBind GhcRn GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-427"></span><span>
</span><span id="line-428"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-var">rnBindLHS</span></a></span><span> </span><span id="local-6989586621681134328"><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134328"><span class="hs-identifier hs-var">name_maker</span></a></span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span id="local-6989586621681134326"><span class="annot"><span class="annottext">XPatSynBind GhcPs GhcPs
</span><a href="#local-6989586621681134326"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681134325"><span class="annot"><span class="annottext">psb :: PatSynBind GhcPs GhcPs
</span><a href="#local-6989586621681134325"><span class="hs-identifier hs-var">psb</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134322"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134322"><span class="hs-identifier hs-var">rdrname</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-429"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; Bool
</span><a href="GHC.Rename.Pat.html#isTopRecNameMaker"><span class="hs-identifier hs-var">isTopRecNameMaker</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134328"><span class="hs-identifier hs-var">name_maker</span></a></span><span>
</span><span id="line-430"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; TcRn ()) -&gt; Located RdrName -&gt; TcRn ()
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM b
</span><a href="GHC.Tc.Utils.Monad.html#addLocM"><span class="hs-identifier hs-var">addLocM</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; TcRn ()
</span><a href="GHC.Rename.Names.html#checkConName"><span class="hs-identifier hs-var">checkConName</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134322"><span class="hs-identifier hs-var">rdrname</span></a></span><span>
</span><span id="line-431"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134318"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134318"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupLocatedTopBndrRn"><span class="hs-identifier hs-var">lookupLocatedTopBndrRn</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134322"><span class="hs-identifier hs-var">rdrname</span></a></span><span>   </span><span class="hs-comment">-- Should be in scope already</span><span>
</span><span id="line-432"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPatSynBind GhcRn GhcPs
-&gt; PatSynBind GhcRn GhcPs -&gt; HsBindLR GhcRn GhcPs
forall idL idR.
XPatSynBind idL idR -&gt; PatSynBind idL idR -&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-var">PatSynBind</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynBind GhcPs GhcPs
XPatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134326"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcPs GhcPs
</span><a href="#local-6989586621681134325"><span class="hs-identifier hs-var">psb</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_ext :: XPSB GhcRn GhcPs
</span><a href="GHC.Hs.Binds.html#psb_ext"><span class="hs-identifier hs-var">psb_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XPSB GhcRn GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_id :: Located (IdP GhcRn)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134318"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-comment">-- Pattern synonym, not at top level</span><span>
</span><span id="line-435"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681134315"><span class="hs-identifier hs-var">localPatternSynonymErr</span></a></span><span>  </span><span class="hs-comment">-- Complain, but make up a fake</span><span>
</span><span id="line-436"></span><span>                                        </span><span class="hs-comment">-- name so that we can carry on</span><span>
</span><span id="line-437"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134314"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134314"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">NameMaker -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Pat.html#applyNameMaker"><span class="hs-identifier hs-var">applyNameMaker</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><a href="#local-6989586621681134328"><span class="hs-identifier hs-var">name_maker</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134322"><span class="hs-identifier hs-var">rdrname</span></a></span><span>
</span><span id="line-438"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; TcM (HsBindLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPatSynBind GhcRn GhcPs
-&gt; PatSynBind GhcRn GhcPs -&gt; HsBindLR GhcRn GhcPs
forall idL idR.
XPatSynBind idL idR -&gt; PatSynBind idL idR -&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-var">PatSynBind</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynBind GhcPs GhcPs
XPatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134326"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcPs GhcPs
</span><a href="#local-6989586621681134325"><span class="hs-identifier hs-var">psb</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_ext :: XPSB GhcRn GhcPs
</span><a href="GHC.Hs.Binds.html#psb_ext"><span class="hs-identifier hs-var">psb_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XPSB GhcRn GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_id :: Located (IdP GhcRn)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134314"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-439"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-440"></span><span>    </span><span class="annot"><a href="#local-6989586621681134315"><span class="hs-identifier hs-type">localPatternSynonymErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-441"></span><span>    </span><span id="local-6989586621681134315"><span class="annot"><span class="annottext">localPatternSynonymErr :: MsgDoc
</span><a href="#local-6989586621681134315"><span class="hs-identifier hs-var hs-var">localPatternSynonymErr</span></a></span></span><span>
</span><span id="line-442"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Illegal pattern synonym declaration for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134322"><span class="hs-identifier hs-var">rdrname</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-443"></span><span>           </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern synonym declarations are only valid at top level&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBindLHS"><span class="hs-identifier hs-var">rnBindLHS</span></a></span><span> </span><span class="annot"><span class="annottext">NameMaker
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134311"><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134311"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcM (HsBindLR GhcRn GhcPs)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnBindHS&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134311"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span>
</span><span id="line-447"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnLBind"><span class="hs-identifier hs-type">rnLBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- Signature tyvar function</span><span>
</span><span id="line-448"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBindLR"><span class="hs-identifier hs-type">LHsBindLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-449"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#Uses"><span class="hs-identifier hs-type">Uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span id="rnLBind"><span class="annot"><span class="annottext">rnLBind :: (Name -&gt; [Name])
-&gt; GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnLBind"><span class="hs-identifier hs-var hs-var">rnLBind</span></a></span></span><span> </span><span id="local-6989586621681134308"><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134308"><span class="hs-identifier hs-var">sig_fn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134307"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134307"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681134306"><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134306"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-451"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134307"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-452"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134304"><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681134304"><span class="hs-identifier hs-var">bind'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134303"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134303"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134302"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134302"><span class="hs-identifier hs-var">dus</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; [Name])
-&gt; HsBindLR GhcRn GhcPs -&gt; RnM (HsBind GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-var">rnBind</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134308"><span class="hs-identifier hs-var">sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134306"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-453"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsBind GhcRn, [Name], NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsBind GhcRn -&gt; LHsBind GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134307"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681134304"><span class="hs-identifier hs-var">bind'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134303"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134302"><span class="hs-identifier hs-var">dus</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span class="hs-comment">-- assumes the left-hands-side vars are in scope</span><span>
</span><span id="line-456"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-type">rnBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>        </span><span class="hs-comment">-- Signature tyvar function</span><span>
</span><span id="line-457"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsBindLR"><span class="hs-identifier hs-type">HsBindLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-458"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#HsBind"><span class="hs-identifier hs-type">HsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#Uses"><span class="hs-identifier hs-type">Uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-459"></span><span id="rnBind"><span class="annot"><span class="annottext">rnBind :: (Name -&gt; [Name])
-&gt; HsBindLR GhcRn GhcPs -&gt; RnM (HsBind GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-var hs-var">rnBind</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134300"><span class="annot"><span class="annottext">bind :: HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134300"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatBind"><span class="hs-identifier hs-type">PatBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_lhs :: forall idL idR. HsBindLR idL idR -&gt; LPat idL
</span><a href="GHC.Hs.Binds.html#pat_lhs"><span class="hs-identifier hs-var">pat_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134299"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681134299"><span class="hs-identifier hs-var">pat</span></a></span></span><span>
</span><span id="line-460"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_rhs :: forall idL idR. HsBindLR idL idR -&gt; GRHSs idR (LHsExpr idR)
</span><a href="GHC.Hs.Binds.html#pat_rhs"><span class="hs-identifier hs-var">pat_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134297"><span class="annot"><span class="annottext">GRHSs GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134297"><span class="hs-identifier hs-var">grhss</span></a></span></span><span>
</span><span id="line-461"></span><span>                                   </span><span class="hs-comment">-- pat fvs were stored in bind_fvs</span><span>
</span><span id="line-462"></span><span>                                   </span><span class="hs-comment">-- after processing the LHS</span><span>
</span><span id="line-463"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_ext :: forall idL idR. HsBindLR idL idR -&gt; XPatBind idL idR
</span><a href="GHC.Hs.Binds.html#pat_ext"><span class="hs-identifier hs-var">pat_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134296"><span class="annot"><span class="annottext">XPatBind GhcRn GhcPs
</span><a href="#local-6989586621681134296"><span class="hs-identifier hs-var">pat_fvs</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-464"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134295"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134295"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-465"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134293"><span class="annot"><span class="annottext">GRHSs GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134293"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134292"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134292"><span class="hs-identifier hs-var">rhs_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet))
-&gt; GRHSs GhcPs (LHsExpr GhcPs)
-&gt; RnM (GRHSs GhcRn (LHsExpr GhcRn), NameSet)
forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHSs GhcPs (Located (body GhcPs))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHSs"><span class="hs-identifier hs-var">rnGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatBindRhs"><span class="hs-identifier hs-var">PatBindRhs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134297"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-466"></span><span>
</span><span id="line-467"></span><span>                </span><span class="hs-comment">-- No scoped type variables for pattern bindings</span><span>
</span><span id="line-468"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134290"><span class="annot"><span class="annottext">all_fvs :: NameSet
</span><a href="#local-6989586621681134290"><span class="hs-identifier hs-var hs-var">all_fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XPatBind GhcRn GhcPs
</span><a href="#local-6989586621681134296"><span class="hs-identifier hs-var">pat_fvs</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134292"><span class="hs-identifier hs-var">rhs_fvs</span></a></span><span>
</span><span id="line-469"></span><span>              </span><span id="local-6989586621681134289"><span class="annot"><span class="annottext">fvs' :: NameSet
</span><a href="#local-6989586621681134289"><span class="hs-identifier hs-var hs-var">fvs'</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#filterNameSet"><span class="hs-identifier hs-var">filterNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134295"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134290"><span class="hs-identifier hs-var">all_fvs</span></a></span><span>
</span><span id="line-470"></span><span>                </span><span class="hs-comment">-- Keep locally-defined Names</span><span>
</span><span id="line-471"></span><span>                </span><span class="hs-comment">-- As well as dependency analysis, we need these for the</span><span>
</span><span id="line-472"></span><span>                </span><span class="hs-comment">-- MonoLocalBinds test in GHC.Tc.Gen.Bind.decideGeneralisationPlan</span><span>
</span><span id="line-473"></span><span>              </span><span id="local-6989586621681134286"><span class="annot"><span class="annottext">bndrs :: [IdP GhcRn]
</span><a href="#local-6989586621681134286"><span class="hs-identifier hs-var hs-var">bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LPat GhcRn -&gt; [IdP GhcRn]
forall p. CollectPass p =&gt; LPat p -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectPatBinders"><span class="hs-identifier hs-var">collectPatBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681134299"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-474"></span><span>              </span><span id="local-6989586621681134284"><span class="annot"><span class="annottext">bind' :: HsBind GhcRn
</span><a href="#local-6989586621681134284"><span class="hs-identifier hs-var hs-var">bind'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134300"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_rhs :: GRHSs GhcRn (LHsExpr GhcRn)
</span><a href="GHC.Hs.Binds.html#pat_rhs"><span class="hs-identifier hs-var">pat_rhs</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134293"><span class="hs-identifier hs-var">grhss'</span></a></span><span>
</span><span id="line-475"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_ext :: XPatBind GhcRn GhcRn
</span><a href="GHC.Hs.Binds.html#pat_ext"><span class="hs-identifier hs-var">pat_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XPatBind GhcRn GhcRn
</span><a href="#local-6989586621681134289"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-476"></span><span>
</span><span id="line-477"></span><span>              </span><span id="local-6989586621681134283"><span class="annot"><span class="annottext">ok_nobind_pat :: Bool
</span><a href="#local-6989586621681134283"><span class="hs-identifier hs-var hs-var">ok_nobind_pat</span></a></span></span><span>
</span><span id="line-478"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- See Note [Pattern bindings that bind no variables]</span><span>
</span><span id="line-479"></span><span>                    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn) -&gt; Pat GhcRn
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134299"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-480"></span><span>                       </span><span class="annot"><a href="GHC.Hs.Pat.html#WildPat"><span class="hs-identifier hs-type">WildPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-481"></span><span>                       </span><span class="annot"><a href="GHC.Hs.Pat.html#BangPat"><span class="hs-identifier hs-type">BangPat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-comment">-- #9127, #13646</span><span>
</span><span id="line-482"></span><span>                       </span><span class="annot"><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-type">SplicePat</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-483"></span><span>                       </span><span class="annot"><span class="annottext">Pat GhcRn
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span>        </span><span class="hs-comment">-- Warn if the pattern binds no variables</span><span>
</span><span id="line-486"></span><span>        </span><span class="hs-comment">-- See Note [Pattern bindings that bind no variables]</span><span>
</span><span id="line-487"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; TcRn () -&gt; TcRn ()
forall gbl lcl.
WarningFlag -&gt; TcRnIf gbl lcl () -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#whenWOptM"><span class="hs-identifier hs-var">whenWOptM</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedPatternBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedPatternBinds</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-488"></span><span>          </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681134286"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134283"><span class="hs-identifier hs-var">ok_nobind_pat</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-489"></span><span>          </span><span class="annot"><span class="annottext">WarnReason -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarn"><span class="hs-identifier hs-var">addWarn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnUnusedPatternBinds"><span class="hs-identifier hs-var">Opt_WarnUnusedPatternBinds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-490"></span><span>          </span><span class="annot"><span class="annottext">HsBind GhcRn -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#unusedPatBindWarn"><span class="hs-identifier hs-var">unusedPatBindWarn</span></a></span><span> </span><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681134284"><span class="hs-identifier hs-var">bind'</span></a></span><span>
</span><span id="line-491"></span><span>
</span><span id="line-492"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134289"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="hs-comment">-- See Note [Free-variable space leak]</span><span>
</span><span id="line-493"></span><span>          </span><span class="annot"><span class="annottext">(HsBind GhcRn, [Name], NameSet)
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681134284"><span class="hs-identifier hs-var">bind'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
[IdP GhcRn]
</span><a href="#local-6989586621681134286"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134290"><span class="hs-identifier hs-var">all_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-494"></span><span>
</span><span id="line-495"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-var">rnBind</span></a></span><span> </span><span id="local-6989586621681134269"><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134269"><span class="hs-identifier hs-var">sig_fn</span></a></span></span><span> </span><span id="local-6989586621681134268"><span class="annot"><span class="annottext">bind :: HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134268"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134267"><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681134267"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-496"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_matches :: forall idL idR. HsBindLR idL idR -&gt; MatchGroup idR (LHsExpr idR)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134265"><span class="annot"><span class="annottext">MatchGroup GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134265"><span class="hs-identifier hs-var">matches</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-497"></span><span>       </span><span class="hs-comment">-- invariant: no free vars here when it's a FunBind</span><span>
</span><span id="line-498"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134264"><span class="annot"><span class="annottext">plain_name :: Name
</span><a href="#local-6989586621681134264"><span class="hs-identifier hs-var hs-var">plain_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134267"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-499"></span><span>
</span><span id="line-500"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134263"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134263"><span class="hs-identifier hs-var">matches'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134262"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134262"><span class="hs-identifier hs-var">rhs_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.HsType.html#bindSigTyVarsFV"><span class="hs-identifier hs-var">bindSigTyVarsFV</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134269"><span class="hs-identifier hs-var">sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134264"><span class="hs-identifier hs-var">plain_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
 -&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet))
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-501"></span><span>                                </span><span class="hs-comment">-- bindSigTyVars tests for LangExt.ScopedTyVars</span><span>
</span><span id="line-502"></span><span>                                 </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet))
-&gt; MatchGroup GhcPs (LHsExpr GhcPs)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; MatchGroup GhcPs (Located (body GhcPs))
-&gt; RnM (MatchGroup GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatchGroup"><span class="hs-identifier hs-var">rnMatchGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP GhcRn) -&gt; HsMatchContext GhcRn
forall p. LIdP p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Utils.html#mkPrefixFunRhs"><span class="hs-identifier hs-var">mkPrefixFunRhs</span></a></span><span> </span><span class="annot"><span class="annottext">Located (IdP GhcRn)
</span><a href="#local-6989586621681134267"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-503"></span><span>                                              </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134265"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-504"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134259"><span class="annot"><span class="annottext">is_infix :: Bool
</span><a href="#local-6989586621681134259"><span class="hs-identifier hs-var hs-var">is_infix</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; Bool
forall id1 id2. HsBindLR id1 id2 -&gt; Bool
</span><a href="GHC.Hs.Utils.html#isInfixFunBind"><span class="hs-identifier hs-var">isInfixFunBind</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134268"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-505"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134259"><span class="hs-identifier hs-var">is_infix</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; MatchGroup GhcRn (LHsExpr GhcRn) -&gt; TcRn ()
forall body. Name -&gt; MatchGroup GhcRn body -&gt; TcRn ()
</span><a href="GHC.Rename.HsType.html#checkPrecMatch"><span class="hs-identifier hs-var">checkPrecMatch</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134264"><span class="hs-identifier hs-var">plain_name</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134263"><span class="hs-identifier hs-var">matches'</span></a></span><span>
</span><span id="line-506"></span><span>
</span><span id="line-507"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134256"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134256"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-508"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134255"><span class="annot"><span class="annottext">fvs' :: NameSet
</span><a href="#local-6989586621681134255"><span class="hs-identifier hs-var hs-var">fvs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#filterNameSet"><span class="hs-identifier hs-var">filterNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134256"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134262"><span class="hs-identifier hs-var">rhs_fvs</span></a></span><span>
</span><span id="line-509"></span><span>                </span><span class="hs-comment">-- Keep locally-defined Names</span><span>
</span><span id="line-510"></span><span>                </span><span class="hs-comment">-- As well as dependency analysis, we need these for the</span><span>
</span><span id="line-511"></span><span>                </span><span class="hs-comment">-- MonoLocalBinds test in GHC.Tc.Gen.Bind.decideGeneralisationPlan</span><span>
</span><span id="line-512"></span><span>
</span><span id="line-513"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134255"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="hs-comment">-- See Note [Free-variable space leak]</span><span>
</span><span id="line-514"></span><span>          </span><span class="annot"><span class="annottext">(HsBind GhcRn, [Name], NameSet)
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134268"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_matches :: MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134263"><span class="hs-identifier hs-var">matches'</span></a></span><span>
</span><span id="line-515"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: XFunBind GhcRn GhcRn
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XFunBind GhcRn GhcRn
</span><a href="#local-6989586621681134255"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-516"></span><span>                  </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134264"><span class="hs-identifier hs-var">plain_name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134262"><span class="hs-identifier hs-var">rhs_fvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-517"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-518"></span><span>
</span><span id="line-519"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-var">rnBind</span></a></span><span> </span><span id="local-6989586621681134254"><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134254"><span class="hs-identifier hs-var">sig_fn</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span id="local-6989586621681134253"><span class="annot"><span class="annottext">XPatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134253"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681134252"><span class="annot"><span class="annottext">PatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134252"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134251"><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681134251"><span class="hs-identifier hs-var">bind'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134250"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134250"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134249"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134249"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; [Name])
-&gt; PatSynBind GhcRn GhcPs
-&gt; RnM (PatSynBind GhcRn GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnPatSynBind"><span class="hs-identifier hs-var">rnPatSynBind</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134254"><span class="hs-identifier hs-var">sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134252"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-521"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBind GhcRn, [Name], NameSet)
-&gt; RnM (HsBind GhcRn, [Name], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPatSynBind GhcRn GhcRn -&gt; PatSynBind GhcRn GhcRn -&gt; HsBind GhcRn
forall idL idR.
XPatSynBind idL idR -&gt; PatSynBind idL idR -&gt; HsBindLR idL idR
</span><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-var">PatSynBind</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynBind GhcRn GhcPs
XPatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681134253"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681134251"><span class="hs-identifier hs-var">bind'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134250"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134249"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnBind"><span class="hs-identifier hs-var">rnBind</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134247"><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134247"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; RnM (HsBind GhcRn, [Name], NameSet)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnBind&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134247"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-524"></span><span>
</span><span id="line-525"></span><span class="hs-comment">{- Note [Pattern bindings that bind no variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generally, we want to warn about pattern bindings like
  Just _ = e
because they don't do anything!  But we have three exceptions:

* A wildcard pattern
       _ = rhs
  which (a) is not that different from  _v = rhs
        (b) is sometimes used to give a type sig for,
            or an occurrence of, a variable on the RHS

* A strict pattern binding; that is, one with an outermost bang
     !Just _ = e
  This can fail, so unlike the lazy variant, it is not a no-op.
  Moreover, #13646 argues that even for single constructor
  types, you might want to write the constructor.  See also #9127.

* A splice pattern
      $(th-lhs) = rhs
   It is impossible to determine whether or not th-lhs really
   binds any variable. We should disable the warning for any pattern
   which contain splices, but that is a more expensive check.

Note [Free-variable space leak]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We have
    fvs' = trim fvs
and we seq fvs' before turning it as part of a record.

The reason is that trim is sometimes something like
    \xs -&gt; intersectNameSet (mkNameSet bound_names) xs
and we don't want to retain the list bound_names. This showed up in
trac ticket #1136.
-}</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Dependency analysis and other support functions
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span class="annot"><a href="GHC.Rename.Bind.html#depAnalBinds"><span class="hs-identifier hs-type">depAnalBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#Uses"><span class="hs-identifier hs-type">Uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-568"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#RecFlag"><span class="hs-identifier hs-type">RecFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#DefUses"><span class="hs-identifier hs-type">DefUses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span class="hs-comment">-- Dependency analysis; this is important so that</span><span>
</span><span id="line-570"></span><span class="hs-comment">-- unused-binding reporting is accurate</span><span>
</span><span id="line-571"></span><span id="depAnalBinds"><span class="annot"><span class="annottext">depAnalBinds :: Bag (LHsBind GhcRn, [Name], NameSet)
-&gt; ([(RecFlag, LHsBinds GhcRn)], DefUses)
</span><a href="GHC.Rename.Bind.html#depAnalBinds"><span class="hs-identifier hs-var hs-var">depAnalBinds</span></a></span></span><span> </span><span id="local-6989586621681134246"><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134246"><span class="hs-identifier hs-var">binds_w_dus</span></a></span></span><span>
</span><span id="line-572"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SCC (LHsBind GhcRn, [Name], NameSet) -&gt; (RecFlag, LHsBinds GhcRn))
-&gt; [SCC (LHsBind GhcRn, [Name], NameSet)]
-&gt; [(RecFlag, LHsBinds GhcRn)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SCC (LHsBind GhcRn, [Name], NameSet) -&gt; (RecFlag, LHsBinds GhcRn)
forall {a} {b} {c}. SCC (a, b, c) -&gt; (RecFlag, Bag a)
</span><a href="#local-6989586621681134245"><span class="hs-identifier hs-var">get_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (LHsBind GhcRn, [Name], NameSet)]
</span><a href="#local-6989586621681134244"><span class="hs-identifier hs-var">sccs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Maybe NameSet, NameSet)] -&gt; DefUses
forall a. [a] -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#toOL"><span class="hs-identifier hs-var">toOL</span></a></span><span> </span><span class="annot"><span class="annottext">([(Maybe NameSet, NameSet)] -&gt; DefUses)
-&gt; [(Maybe NameSet, NameSet)] -&gt; DefUses
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(SCC (LHsBind GhcRn, [Name], NameSet) -&gt; (Maybe NameSet, NameSet))
-&gt; [SCC (LHsBind GhcRn, [Name], NameSet)]
-&gt; [(Maybe NameSet, NameSet)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SCC (LHsBind GhcRn, [Name], NameSet) -&gt; (Maybe NameSet, NameSet)
forall {a}. SCC (a, [Name], NameSet) -&gt; (Maybe NameSet, NameSet)
</span><a href="#local-6989586621681134242"><span class="hs-identifier hs-var">get_du</span></a></span><span> </span><span class="annot"><span class="annottext">[SCC (LHsBind GhcRn, [Name], NameSet)]
</span><a href="#local-6989586621681134244"><span class="hs-identifier hs-var">sccs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-573"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-574"></span><span>    </span><span id="local-6989586621681134244"><span class="annot"><span class="annottext">sccs :: [SCC (LHsBind GhcRn, [Name], NameSet)]
</span><a href="#local-6989586621681134244"><span class="hs-identifier hs-var hs-var">sccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LHsBind GhcRn, [Name], NameSet) -&gt; [Name])
-&gt; ((LHsBind GhcRn, [Name], NameSet) -&gt; [Name])
-&gt; [(LHsBind GhcRn, [Name], NameSet)]
-&gt; [SCC (LHsBind GhcRn, [Name], NameSet)]
forall node.
(node -&gt; [Name]) -&gt; (node -&gt; [Name]) -&gt; [node] -&gt; [SCC node]
</span><a href="GHC.Types.Name.Env.html#depAnal"><span class="hs-identifier hs-var">depAnal</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBind GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134240"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134240"><span class="hs-identifier hs-var">defs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134240"><span class="hs-identifier hs-var">defs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-575"></span><span>                   </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBind GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134239"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134239"><span class="hs-identifier hs-var">uses</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; [Name]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134239"><span class="hs-identifier hs-var">uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-576"></span><span>                   </span><span class="hs-comment">-- It's OK to use nonDetEltsUniqSet here as explained in</span><span>
</span><span id="line-577"></span><span>                   </span><span class="hs-comment">-- Note [depAnal determinism] in GHC.Types.Name.Env.</span><span>
</span><span id="line-578"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
-&gt; [(LHsBind GhcRn, [Name], NameSet)]
forall a. Bag a -&gt; [a]
</span><a href="GHC.Data.Bag.html#bagToList"><span class="hs-identifier hs-var">bagToList</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134246"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>
</span><span id="line-580"></span><span>    </span><span id="local-6989586621681134245"><span class="annot"><span class="annottext">get_binds :: SCC (a, b, c) -&gt; (RecFlag, Bag a)
</span><a href="#local-6989586621681134245"><span class="hs-identifier hs-var hs-var">get_binds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134235"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681134235"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#NonRecursive"><span class="hs-identifier hs-var">NonRecursive</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a -&gt; Bag a
forall a. a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#unitBag"><span class="hs-identifier hs-var">unitBag</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681134235"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-581"></span><span>    </span><span class="annot"><a href="#local-6989586621681134245"><span class="hs-identifier hs-var">get_binds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span>  </span><span id="local-6989586621681134231"><span class="annot"><span class="annottext">[(a, b, c)]
</span><a href="#local-6989586621681134231"><span class="hs-identifier hs-var">binds_w_dus</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RecFlag
</span><a href="GHC.Types.Basic.html#Recursive"><span class="hs-identifier hs-var">Recursive</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Bag a
forall a. [a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#listToBag"><span class="hs-identifier hs-var">listToBag</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681134228"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134228"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681134228"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">c
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(a, b, c)]
</span><a href="#local-6989586621681134231"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-582"></span><span>
</span><span id="line-583"></span><span>    </span><span id="local-6989586621681134242"><span class="annot"><span class="annottext">get_du :: SCC (a, [Name], NameSet) -&gt; (Maybe NameSet, NameSet)
</span><a href="#local-6989586621681134242"><span class="hs-identifier hs-var hs-var">get_du</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134227"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134227"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134226"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134226"><span class="hs-identifier hs-var">uses</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet -&gt; Maybe NameSet
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134227"><span class="hs-identifier hs-var">bndrs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134226"><span class="hs-identifier hs-var">uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-584"></span><span>    </span><span class="annot"><a href="#local-6989586621681134242"><span class="hs-identifier hs-var">get_du</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span>  </span><span id="local-6989586621681134225"><span class="annot"><span class="annottext">[(a, [Name], NameSet)]
</span><a href="#local-6989586621681134225"><span class="hs-identifier hs-var">binds_w_dus</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">NameSet -&gt; Maybe NameSet
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134224"><span class="hs-identifier hs-var">defs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134223"><span class="hs-identifier hs-var">uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-585"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-586"></span><span>          </span><span id="local-6989586621681134224"><span class="annot"><span class="annottext">defs :: NameSet
</span><a href="#local-6989586621681134224"><span class="hs-identifier hs-var hs-var">defs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134222"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681134221"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134221"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">NameSet
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(a, [Name], NameSet)]
</span><a href="#local-6989586621681134225"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134222"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134222"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134221"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-587"></span><span>          </span><span id="local-6989586621681134223"><span class="annot"><span class="annottext">uses :: NameSet
</span><a href="#local-6989586621681134223"><span class="hs-identifier hs-var hs-var">uses</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[NameSet] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#unionNameSets"><span class="hs-identifier hs-var">unionNameSets</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134219"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681134219"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134219"><span class="hs-identifier hs-var">u</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(a, [Name], NameSet)]
</span><a href="#local-6989586621681134225"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-588"></span><span>
</span><span id="line-589"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-590"></span><span class="hs-comment">-- Bind the top-level forall'd type variables in the sigs.</span><span>
</span><span id="line-591"></span><span class="hs-comment">-- E.g  f :: forall a. a -&gt; a</span><span>
</span><span id="line-592"></span><span class="hs-comment">--      f = rhs</span><span>
</span><span id="line-593"></span><span class="hs-comment">--      The 'a' scopes over the rhs</span><span>
</span><span id="line-594"></span><span class="hs-comment">--</span><span>
</span><span id="line-595"></span><span class="hs-comment">-- NB: there'll usually be just one (for a function binding)</span><span>
</span><span id="line-596"></span><span class="hs-comment">--     but if there are many, one may shadow the rest; too bad!</span><span>
</span><span id="line-597"></span><span class="hs-comment">--      e.g  x :: forall a. [a] -&gt; [a]</span><span>
</span><span id="line-598"></span><span class="hs-comment">--           y :: forall a. [(a,a)] -&gt; a</span><span>
</span><span id="line-599"></span><span class="hs-comment">--           (x,y) = e</span><span>
</span><span id="line-600"></span><span class="hs-comment">--      In e, 'a' will be in scope, and it'll be the one from 'y'!</span><span>
</span><span id="line-601"></span><span>
</span><span id="line-602"></span><span class="annot"><a href="GHC.Rename.Bind.html#mkScopedTvFn"><span class="hs-identifier hs-type">mkScopedTvFn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-603"></span><span class="hs-comment">-- Return a lookup function that maps an Id Name to the names</span><span>
</span><span id="line-604"></span><span class="hs-comment">-- of the type variables that should scope over its body.</span><span>
</span><span id="line-605"></span><span id="mkScopedTvFn"><span class="annot"><span class="annottext">mkScopedTvFn :: [LSig GhcRn] -&gt; Name -&gt; [Name]
</span><a href="GHC.Rename.Bind.html#mkScopedTvFn"><span class="hs-identifier hs-var hs-var">mkScopedTvFn</span></a></span></span><span> </span><span id="local-6989586621681134218"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134218"><span class="hs-identifier hs-var">sigs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681134217"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134217"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NameEnv [Name] -&gt; Name -&gt; Maybe [Name]
forall a. NameEnv a -&gt; Name -&gt; Maybe a
</span><a href="GHC.Types.Name.Env.html#lookupNameEnv"><span class="hs-identifier hs-var">lookupNameEnv</span></a></span><span> </span><span class="annot"><span class="annottext">NameEnv [Name]
</span><a href="#local-6989586621681134215"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134217"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe [Name] -&gt; [Name] -&gt; [Name]
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-606"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-607"></span><span>    </span><span id="local-6989586621681134215"><span class="annot"><span class="annottext">env :: NameEnv [Name]
</span><a href="#local-6989586621681134215"><span class="hs-identifier hs-var hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; Maybe ([Located Name], [Name]))
-&gt; [LSig GhcRn] -&gt; NameEnv [Name]
forall a.
(LSig GhcRn -&gt; Maybe ([Located Name], a))
-&gt; [LSig GhcRn] -&gt; NameEnv a
</span><a href="GHC.Hs.Utils.html#mkHsSigEnv"><span class="hs-identifier hs-var">mkHsSigEnv</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; Maybe ([Located Name], [Name])
</span><a href="#local-6989586621681134213"><span class="hs-identifier hs-var">get_scoped_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134218"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-608"></span><span>
</span><span id="line-609"></span><span>    </span><span class="annot"><a href="#local-6989586621681134213"><span class="hs-identifier hs-type">get_scoped_tvs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-610"></span><span>    </span><span class="hs-comment">-- Returns (binders, scoped tvs for those binders)</span><span>
</span><span id="line-611"></span><span>    </span><span id="local-6989586621681134213"><span class="annot"><span class="annottext">get_scoped_tvs :: LSig GhcRn -&gt; Maybe ([Located Name], [Name])
</span><a href="#local-6989586621681134213"><span class="hs-identifier hs-var hs-var">get_scoped_tvs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134211"><span class="annot"><span class="annottext">[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134211"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681134210"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134210"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-612"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Located Name], [Name]) -&gt; Maybe ([Located Name], [Name])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134211"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; [Name]
</span><a href="GHC.Hs.Type.html#hsScopedTvs"><span class="hs-identifier hs-var">hsScopedTvs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134210"><span class="hs-identifier hs-var">sig_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-613"></span><span>    </span><span class="annot"><a href="#local-6989586621681134213"><span class="hs-identifier hs-var">get_scoped_tvs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">XTypeSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134207"><span class="annot"><span class="annottext">[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134207"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681134206"><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681134206"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Located Name], [Name]) -&gt; Maybe ([Located Name], [Name])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134207"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn -&gt; [Name]
</span><a href="GHC.Hs.Type.html#hsWcScopedTvs"><span class="hs-identifier hs-var">hsWcScopedTvs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681134206"><span class="hs-identifier hs-var">sig_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-615"></span><span>    </span><span class="annot"><a href="#local-6989586621681134213"><span class="hs-identifier hs-var">get_scoped_tvs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134203"><span class="annot"><span class="annottext">[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134203"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681134202"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134202"><span class="hs-identifier hs-var">sig_ty</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-616"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([Located Name], [Name]) -&gt; Maybe ([Located Name], [Name])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134203"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; [Name]
</span><a href="GHC.Hs.Type.html#hsScopedTvs"><span class="hs-identifier hs-var">hsScopedTvs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134202"><span class="hs-identifier hs-var">sig_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>    </span><span class="annot"><a href="#local-6989586621681134213"><span class="hs-identifier hs-var">get_scoped_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([Located Name], [Name])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span class="hs-comment">-- Process the fixity declarations, making a FastString -&gt; (Located Fixity) map</span><span>
</span><span id="line-620"></span><span class="hs-comment">-- (We keep the location around for reporting duplicate fixity declarations.)</span><span>
</span><span id="line-621"></span><span class="hs-comment">--</span><span>
</span><span id="line-622"></span><span class="hs-comment">-- Checks for duplicates, but not that only locally defined things are fixed.</span><span>
</span><span id="line-623"></span><span class="hs-comment">-- Note: for local fixity declarations, duplicates would also be checked in</span><span>
</span><span id="line-624"></span><span class="hs-comment">--       check_sigs below.  But we also use this function at the top level.</span><span>
</span><span id="line-625"></span><span>
</span><span id="line-626"></span><span class="annot"><a href="GHC.Rename.Bind.html#makeMiniFixityEnv"><span class="hs-identifier hs-type">makeMiniFixityEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LFixitySig"><span class="hs-identifier hs-type">LFixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span>
</span><span id="line-627"></span><span>
</span><span id="line-628"></span><span id="makeMiniFixityEnv"><span class="annot"><span class="annottext">makeMiniFixityEnv :: [LFixitySig GhcPs] -&gt; RnM MiniFixityEnv
</span><a href="GHC.Rename.Bind.html#makeMiniFixityEnv"><span class="hs-identifier hs-var hs-var">makeMiniFixityEnv</span></a></span></span><span> </span><span id="local-6989586621681134201"><span class="annot"><span class="annottext">[LFixitySig GhcPs]
</span><a href="#local-6989586621681134201"><span class="hs-identifier hs-var">decls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(MiniFixityEnv -&gt; LFixitySig GhcPs -&gt; RnM MiniFixityEnv)
-&gt; MiniFixityEnv -&gt; [LFixitySig GhcPs] -&gt; RnM MiniFixityEnv
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Data.Foldable.html#foldlM"><span class="hs-identifier hs-var">foldlM</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv -&gt; LFixitySig GhcPs -&gt; RnM MiniFixityEnv
</span><a href="#local-6989586621681134199"><span class="hs-identifier hs-var">add_one_sig</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
forall a. FastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#emptyFsEnv"><span class="hs-identifier hs-var">emptyFsEnv</span></a></span><span> </span><span class="annot"><span class="annottext">[LFixitySig GhcPs]
</span><a href="#local-6989586621681134201"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-629"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-630"></span><span>   </span><span class="annot"><a href="#local-6989586621681134199"><span class="hs-identifier hs-type">add_one_sig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LFixitySig"><span class="hs-identifier hs-type">LFixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Rename.Fixity.html#MiniFixityEnv"><span class="hs-identifier hs-type">MiniFixityEnv</span></a></span><span>
</span><span id="line-631"></span><span>   </span><span id="local-6989586621681134199"><span class="annot"><span class="annottext">add_one_sig :: MiniFixityEnv -&gt; LFixitySig GhcPs -&gt; RnM MiniFixityEnv
</span><a href="#local-6989586621681134199"><span class="hs-identifier hs-var hs-var">add_one_sig</span></a></span></span><span> </span><span id="local-6989586621681134197"><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134197"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134196"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134196"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixitySig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134194"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134194"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span id="local-6989586621681134193"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681134193"><span class="hs-identifier hs-var">fixity</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-632"></span><span>     </span><span class="annot"><span class="annottext">(MiniFixityEnv
 -&gt; (SrcSpan, SrcSpan, RdrName, Fixity) -&gt; RnM MiniFixityEnv)
-&gt; MiniFixityEnv
-&gt; [(SrcSpan, SrcSpan, RdrName, Fixity)]
-&gt; RnM MiniFixityEnv
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Data.Foldable.html#foldlM"><span class="hs-identifier hs-var">foldlM</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
-&gt; (SrcSpan, SrcSpan, RdrName, Fixity) -&gt; RnM MiniFixityEnv
forall {e}.
FastStringEnv (GenLocated SrcSpan e)
-&gt; (SrcSpan, SrcSpan, RdrName, e)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e))
</span><a href="#local-6989586621681134192"><span class="hs-identifier hs-var">add_one</span></a></span><span> </span><span class="annot"><span class="annottext">MiniFixityEnv
</span><a href="#local-6989586621681134197"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134196"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134191"><span class="hs-identifier hs-var">name_loc</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134190"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681134193"><span class="hs-identifier hs-var">fixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-633"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134191"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134191"><span class="hs-identifier hs-var">name_loc</span></a></span></span><span> </span><span id="local-6989586621681134190"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134190"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134194"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-634"></span><span>
</span><span id="line-635"></span><span>   </span><span id="local-6989586621681134192"><span class="annot"><span class="annottext">add_one :: FastStringEnv (GenLocated SrcSpan e)
-&gt; (SrcSpan, SrcSpan, RdrName, e)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e))
</span><a href="#local-6989586621681134192"><span class="hs-identifier hs-var hs-var">add_one</span></a></span></span><span> </span><span id="local-6989586621681134186"><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
</span><a href="#local-6989586621681134186"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134185"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134185"><span class="hs-identifier hs-var">loc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134184"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134184"><span class="hs-identifier hs-var">name_loc</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134183"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134183"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681134182"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621681134182"><span class="hs-identifier hs-var">fixity</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-636"></span><span>     </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- this fixity decl is a duplicate iff</span><span>
</span><span id="line-637"></span><span>       </span><span class="hs-comment">-- the ReaderName's OccName's FastString is already in the env</span><span>
</span><span id="line-638"></span><span>       </span><span class="hs-comment">-- (we only need to check the local fix_env because</span><span>
</span><span id="line-639"></span><span>       </span><span class="hs-comment">--  definitions of non-local will be caught elsewhere)</span><span>
</span><span id="line-640"></span><span>       </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134181"><span class="annot"><span class="annottext">fs :: FastString
</span><a href="#local-6989586621681134181"><span class="hs-identifier hs-var hs-var">fs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; FastString
</span><a href="GHC.Types.Name.Occurrence.html#occNameFS"><span class="hs-identifier hs-var hs-var">occNameFS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134183"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-641"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134179"><span class="annot"><span class="annottext">fix_item :: GenLocated SrcSpan e
</span><a href="#local-6989586621681134179"><span class="hs-identifier hs-var hs-var">fix_item</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; e -&gt; GenLocated SrcSpan e
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134185"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621681134182"><span class="hs-identifier hs-var">fixity</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">;</span><span>
</span><span id="line-642"></span><span>
</span><span id="line-643"></span><span>       </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
-&gt; FastString -&gt; Maybe (GenLocated SrcSpan e)
forall a. FastStringEnv a -&gt; FastString -&gt; Maybe a
</span><a href="GHC.Data.FastString.Env.html#lookupFsEnv"><span class="hs-identifier hs-var">lookupFsEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
</span><a href="#local-6989586621681134186"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681134181"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-644"></span><span>         </span><span class="annot"><span class="annottext">Maybe (GenLocated SrcSpan e)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(FastStringEnv (GenLocated SrcSpan e)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e)))
-&gt; FastStringEnv (GenLocated SrcSpan e)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
-&gt; FastString
-&gt; GenLocated SrcSpan e
-&gt; FastStringEnv (GenLocated SrcSpan e)
forall a. FastStringEnv a -&gt; FastString -&gt; a -&gt; FastStringEnv a
</span><a href="GHC.Data.FastString.Env.html#extendFsEnv"><span class="hs-identifier hs-var">extendFsEnv</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
</span><a href="#local-6989586621681134186"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681134181"><span class="hs-identifier hs-var">fs</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan e
</span><a href="#local-6989586621681134179"><span class="hs-identifier hs-var">fix_item</span></a></span><span>
</span><span id="line-645"></span><span>         </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134176"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134176"><span class="hs-identifier hs-var">loc'</span></a></span></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-646"></span><span>           </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcRn () -&gt; TcRn ()
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134185"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-647"></span><span>             </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134184"><span class="hs-identifier hs-var">name_loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#dupFixityDecl"><span class="hs-identifier hs-var">dupFixityDecl</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134176"><span class="hs-identifier hs-var">loc'</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134183"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-648"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (FastStringEnv (GenLocated SrcSpan e))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FastStringEnv (GenLocated SrcSpan e)
</span><a href="#local-6989586621681134186"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-649"></span><span>     </span><span class="hs-special">}</span><span>
</span><span id="line-650"></span><span>
</span><span id="line-651"></span><span class="annot"><a href="GHC.Rename.Bind.html#dupFixityDecl"><span class="hs-identifier hs-type">dupFixityDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-652"></span><span id="dupFixityDecl"><span class="annot"><span class="annottext">dupFixityDecl :: SrcSpan -&gt; RdrName -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#dupFixityDecl"><span class="hs-identifier hs-var hs-var">dupFixityDecl</span></a></span></span><span> </span><span id="local-6989586621681134173"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134173"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681134172"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134172"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span>
</span><span id="line-653"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple fixity declarations for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681134172"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-654"></span><span>          </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;also at &quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134173"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-655"></span><span>
</span><span id="line-656"></span><span>
</span><span id="line-657"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                Pattern synonym bindings
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-662"></span><span>
</span><span id="line-663"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnPatSynBind"><span class="hs-identifier hs-type">rnPatSynBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- Signature tyvar function</span><span>
</span><span id="line-664"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-665"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#Uses"><span class="hs-identifier hs-type">Uses</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span id="rnPatSynBind"><span class="annot"><span class="annottext">rnPatSynBind :: (Name -&gt; [Name])
-&gt; PatSynBind GhcRn GhcPs
-&gt; RnM (PatSynBind GhcRn GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnPatSynBind"><span class="hs-identifier hs-var hs-var">rnPatSynBind</span></a></span></span><span> </span><span id="local-6989586621681134170"><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134170"><span class="hs-identifier hs-var">sig_fn</span></a></span></span><span> </span><span id="local-6989586621681134169"><span class="annot"><span class="annottext">bind :: PatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134169"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PSB"><span class="hs-identifier hs-type">PSB</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_id :: forall idL idR. PatSynBind idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#psb_id"><span class="hs-identifier hs-var">psb_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134168"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134168"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681134167"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681134167"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-667"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_args :: forall idL idR.
PatSynBind idL idR -&gt; HsPatSynDetails (Located (IdP idR))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134165"><span class="annot"><span class="annottext">HsPatSynDetails (Located (IdP GhcPs))
</span><a href="#local-6989586621681134165"><span class="hs-identifier hs-var">details</span></a></span></span><span>
</span><span id="line-668"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_def :: forall idL idR. PatSynBind idL idR -&gt; LPat idR
</span><a href="GHC.Hs.Binds.html#psb_def"><span class="hs-identifier hs-var">psb_def</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134163"><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681134163"><span class="hs-identifier hs-var">pat</span></a></span></span><span>
</span><span id="line-669"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_dir :: forall idL idR. PatSynBind idL idR -&gt; HsPatSynDir idR
</span><a href="GHC.Hs.Binds.html#psb_dir"><span class="hs-identifier hs-var">psb_dir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134161"><span class="annot"><span class="annottext">HsPatSynDir GhcPs
</span><a href="#local-6989586621681134161"><span class="hs-identifier hs-var">dir</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-670"></span><span>       </span><span class="hs-comment">-- invariant: no free vars here when it's a FunBind</span><span>
</span><span id="line-671"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134160"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134160"><span class="hs-identifier hs-var">pattern_synonym_ok</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#PatternSynonyms"><span class="hs-identifier hs-var">LangExt.PatternSynonyms</span></a></span><span>
</span><span id="line-672"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134160"><span class="hs-identifier hs-var">pattern_synonym_ok</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681134156"><span class="hs-identifier hs-var">patternSynonymErr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-673"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134155"><span class="annot"><span class="annottext">scoped_tvs :: [Name]
</span><a href="#local-6989586621681134155"><span class="hs-identifier hs-var hs-var">scoped_tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name]
</span><a href="#local-6989586621681134170"><span class="hs-identifier hs-var">sig_fn</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681134167"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681134154"><span class="annot"><span class="annottext">Located (Pat GhcRn)
</span><a href="#local-6989586621681134154"><span class="hs-identifier hs-var">pat'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134153"><span class="annot"><span class="annottext">HsConDetails (Located Name) [RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134153"><span class="hs-identifier hs-var">details'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134152"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134152"><span class="hs-identifier hs-var">fvs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.HsType.html#bindSigTyVarsFV"><span class="hs-identifier hs-var">bindSigTyVarsFV</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134155"><span class="hs-identifier hs-var">scoped_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM
   ((Located (Pat GhcRn),
     HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
    NameSet)
 -&gt; RnM
      ((Located (Pat GhcRn),
        HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
       NameSet))
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-676"></span><span>                                      </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; LPat GhcPs
-&gt; (LPat GhcRn
    -&gt; RnM
         ((Located (Pat GhcRn),
           HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
          NameSet))
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall a.
HsMatchContext GhcRn
-&gt; LPat GhcPs
-&gt; (LPat GhcRn -&gt; RnM (a, NameSet))
-&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.Pat.html#rnPat"><span class="hs-identifier hs-var">rnPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatSyn"><span class="hs-identifier hs-var">PatSyn</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681134163"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">((LPat GhcRn
  -&gt; RnM
       ((Located (Pat GhcRn),
         HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
        NameSet))
 -&gt; RnM
      ((Located (Pat GhcRn),
        HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
       NameSet))
-&gt; (LPat GhcRn
    -&gt; RnM
         ((Located (Pat GhcRn),
           HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
          NameSet))
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681134149"><span class="annot"><span class="annottext">LPat GhcRn
</span><a href="#local-6989586621681134149"><span class="hs-identifier hs-var">pat'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-677"></span><span>         </span><span class="hs-comment">-- We check the 'RdrName's instead of the 'Name's</span><span>
</span><span id="line-678"></span><span>         </span><span class="hs-comment">-- so that the binding locations are reported</span><span>
</span><span id="line-679"></span><span>         </span><span class="hs-comment">-- from the left-hand side</span><span>
</span><span id="line-680"></span><span>            </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsPatSynDetails (Located (IdP GhcPs))
</span><a href="#local-6989586621681134165"><span class="hs-identifier hs-var">details</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-681"></span><span>               </span><span class="annot"><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-type">PrefixCon</span></a></span><span> </span><span id="local-6989586621681134147"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134147"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-682"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">[Located RdrName] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-var">checkDupRdrNames</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134147"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-683"></span><span>                      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134146"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681134146"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="#local-6989586621681134144"><span class="hs-identifier hs-var">lookupPatSynBndr</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134147"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-684"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((Located (Pat GhcRn),
  HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
 NameSet)
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134149"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Located Name]
-&gt; HsConDetails (Located Name) [RecordPatSynField (Located Name)]
forall arg rec. [arg] -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#PrefixCon"><span class="hs-identifier hs-var">PrefixCon</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681134146"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-685"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkFVs"><span class="hs-identifier hs-var">mkFVs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name) -&gt; [Located Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681134146"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-686"></span><span>               </span><span class="annot"><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-type">InfixCon</span></a></span><span> </span><span id="local-6989586621681134141"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134141"><span class="hs-identifier hs-var">var1</span></a></span></span><span> </span><span id="local-6989586621681134140"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134140"><span class="hs-identifier hs-var">var2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-687"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">[Located RdrName] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-var">checkDupRdrNames</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134141"><span class="hs-identifier hs-var">var1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134140"><span class="hs-identifier hs-var">var2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-688"></span><span>                      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134139"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134139"><span class="hs-identifier hs-var">name1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="#local-6989586621681134144"><span class="hs-identifier hs-var">lookupPatSynBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134141"><span class="hs-identifier hs-var">var1</span></a></span><span>
</span><span id="line-689"></span><span>                      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134138"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134138"><span class="hs-identifier hs-var">name2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="#local-6989586621681134144"><span class="hs-identifier hs-var">lookupPatSynBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134140"><span class="hs-identifier hs-var">var2</span></a></span><span>
</span><span id="line-690"></span><span>                      </span><span class="hs-comment">-- ; checkPrecMatch -- TODO</span><span>
</span><span id="line-691"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((Located (Pat GhcRn),
  HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
 NameSet)
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134149"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located Name
-&gt; Located Name
-&gt; HsConDetails (Located Name) [RecordPatSynField (Located Name)]
forall arg rec. arg -&gt; arg -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#InfixCon"><span class="hs-identifier hs-var">InfixCon</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134139"><span class="hs-identifier hs-var">name1</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134138"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-692"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkFVs"><span class="hs-identifier hs-var">mkFVs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Name) -&gt; [Located Name] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134139"><span class="hs-identifier hs-var">name1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134138"><span class="hs-identifier hs-var">name2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-693"></span><span>               </span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681134136"><span class="annot"><span class="annottext">[RecordPatSynField (Located (IdP GhcPs))]
</span><a href="#local-6989586621681134136"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-694"></span><span>                   </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">[Located RdrName] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-var">checkDupRdrNames</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RecordPatSynField (Located RdrName) -&gt; Located RdrName)
-&gt; [RecordPatSynField (Located RdrName)] -&gt; [Located RdrName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located RdrName) -&gt; Located RdrName
forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynSelectorId"><span class="hs-identifier hs-var hs-var">recordPatSynSelectorId</span></a></span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located RdrName)]
[RecordPatSynField (Located (IdP GhcPs))]
</span><a href="#local-6989586621681134136"><span class="hs-identifier hs-var">vars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134131"><span class="annot"><span class="annottext">rnRecordPatSynField :: RecordPatSynField (Located RdrName)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name))
</span><a href="#local-6989586621681134131"><span class="hs-identifier hs-var hs-var">rnRecordPatSynField</span></a></span></span><span>
</span><span id="line-696"></span><span>                              </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#RecordPatSynField"><span class="hs-identifier hs-type">RecordPatSynField</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recordPatSynSelectorId :: forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynSelectorId"><span class="hs-identifier hs-var">recordPatSynSelectorId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134129"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134129"><span class="hs-identifier hs-var">visible</span></a></span></span><span>
</span><span id="line-697"></span><span>                                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recordPatSynPatVar :: forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynPatVar"><span class="hs-identifier hs-var">recordPatSynPatVar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134127"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134127"><span class="hs-identifier hs-var">hidden</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-698"></span><span>                              </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134126"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134126"><span class="hs-identifier hs-var">visible'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupLocatedTopBndrRn"><span class="hs-identifier hs-var">lookupLocatedTopBndrRn</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134129"><span class="hs-identifier hs-var">visible</span></a></span><span>
</span><span id="line-699"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134125"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134125"><span class="hs-identifier hs-var">hidden'</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="#local-6989586621681134144"><span class="hs-identifier hs-var">lookupPatSynBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134127"><span class="hs-identifier hs-var">hidden</span></a></span><span>
</span><span id="line-700"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(RecordPatSynField (Located Name)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name)))
-&gt; RecordPatSynField (Located Name)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField :: forall a. a -&gt; a -&gt; RecordPatSynField a
</span><a href="GHC.Hs.Binds.html#RecordPatSynField"><span class="hs-identifier hs-type">RecordPatSynField</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">recordPatSynSelectorId :: Located Name
</span><a href="GHC.Hs.Binds.html#recordPatSynSelectorId"><span class="hs-identifier hs-var">recordPatSynSelectorId</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134126"><span class="hs-identifier hs-var">visible'</span></a></span><span>
</span><span id="line-701"></span><span>                                                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">recordPatSynPatVar :: Located Name
</span><a href="GHC.Hs.Binds.html#recordPatSynPatVar"><span class="hs-identifier hs-var">recordPatSynPatVar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134125"><span class="hs-identifier hs-var">hidden'</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-702"></span><span>                      </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134124"><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134124"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(RecordPatSynField (Located RdrName)
 -&gt; IOEnv
      (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name)))
-&gt; [RecordPatSynField (Located RdrName)]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [RecordPatSynField (Located Name)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located RdrName)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (RecordPatSynField (Located Name))
</span><a href="#local-6989586621681134131"><span class="hs-identifier hs-var">rnRecordPatSynField</span></a></span><span>  </span><span class="annot"><span class="annottext">[RecordPatSynField (Located RdrName)]
[RecordPatSynField (Located (IdP GhcPs))]
</span><a href="#local-6989586621681134136"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-703"></span><span>                      </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">((Located (Pat GhcRn),
  HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
 NameSet)
-&gt; RnM
     ((Located (Pat GhcRn),
       HsConDetails (Located Name) [RecordPatSynField (Located Name)]),
      NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134149"><span class="hs-identifier hs-var">pat'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
-&gt; HsConDetails (Located Name) [RecordPatSynField (Located Name)]
forall arg rec. rec -&gt; HsConDetails arg rec
</span><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-var">RecCon</span></a></span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134124"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-704"></span><span>                               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkFVs"><span class="hs-identifier hs-var">mkFVs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(RecordPatSynField (Located Name) -&gt; Name)
-&gt; [RecordPatSynField (Located Name)] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Located Name -&gt; Name)
-&gt; (RecordPatSynField (Located Name) -&gt; Located Name)
-&gt; RecordPatSynField (Located Name)
-&gt; Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located Name) -&gt; Located Name
forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynPatVar"><span class="hs-identifier hs-var hs-var">recordPatSynPatVar</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134124"><span class="hs-identifier hs-var">names</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-705"></span><span>
</span><span id="line-706"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134123"><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681134123"><span class="hs-identifier hs-var">dir'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134122"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134122"><span class="hs-identifier hs-var">fvs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcPs
</span><a href="#local-6989586621681134161"><span class="hs-identifier hs-var">dir</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-707"></span><span>            </span><span class="annot"><span class="annottext">HsPatSynDir GhcPs
</span><a href="GHC.Hs.Binds.html#Unidirectional"><span class="hs-identifier hs-var">Unidirectional</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(HsPatSynDir GhcRn, NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (HsPatSynDir GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
forall id. HsPatSynDir id
</span><a href="GHC.Hs.Binds.html#Unidirectional"><span class="hs-identifier hs-var">Unidirectional</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-708"></span><span>            </span><span class="annot"><span class="annottext">HsPatSynDir GhcPs
</span><a href="GHC.Hs.Binds.html#ImplicitBidirectional"><span class="hs-identifier hs-var">ImplicitBidirectional</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(HsPatSynDir GhcRn, NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (HsPatSynDir GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
forall id. HsPatSynDir id
</span><a href="GHC.Hs.Binds.html#ImplicitBidirectional"><span class="hs-identifier hs-var">ImplicitBidirectional</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-709"></span><span>            </span><span class="annot"><a href="GHC.Hs.Binds.html#ExplicitBidirectional"><span class="hs-identifier hs-type">ExplicitBidirectional</span></a></span><span> </span><span id="local-6989586621681134117"><span class="annot"><span class="annottext">MatchGroup GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134117"><span class="hs-identifier hs-var">mg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-710"></span><span>                </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134116"><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134116"><span class="hs-identifier hs-var">mg'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134115"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134115"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.HsType.html#bindSigTyVarsFV"><span class="hs-identifier hs-var">bindSigTyVarsFV</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134155"><span class="hs-identifier hs-var">scoped_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
 -&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet))
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-711"></span><span>                                   </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet))
-&gt; MatchGroup GhcPs (LHsExpr GhcPs)
-&gt; RnM (MatchGroup GhcRn (LHsExpr GhcRn), NameSet)
forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; MatchGroup GhcPs (Located (body GhcPs))
-&gt; RnM (MatchGroup GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatchGroup"><span class="hs-identifier hs-var">rnMatchGroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP GhcRn) -&gt; HsMatchContext GhcRn
forall p. LIdP p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Utils.html#mkPrefixFunRhs"><span class="hs-identifier hs-var">mkPrefixFunRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134168"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681134167"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-712"></span><span>                                                </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcPs (LHsExpr GhcPs)
</span><a href="#local-6989586621681134117"><span class="hs-identifier hs-var">mg</span></a></span><span>
</span><span id="line-713"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsPatSynDir GhcRn, NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (HsPatSynDir GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn) -&gt; HsPatSynDir GhcRn
forall id. MatchGroup id (LHsExpr id) -&gt; HsPatSynDir id
</span><a href="GHC.Hs.Binds.html#ExplicitBidirectional"><span class="hs-identifier hs-var">ExplicitBidirectional</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcRn (LHsExpr GhcRn)
</span><a href="#local-6989586621681134116"><span class="hs-identifier hs-var">mg'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134115"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134114"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134114"><span class="hs-identifier hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-716"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134113"><span class="annot"><span class="annottext">fvs :: NameSet
</span><a href="#local-6989586621681134113"><span class="hs-identifier hs-var hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134152"><span class="hs-identifier hs-var">fvs1</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134122"><span class="hs-identifier hs-var">fvs2</span></a></span><span>
</span><span id="line-717"></span><span>              </span><span id="local-6989586621681134112"><span class="annot"><span class="annottext">fvs' :: NameSet
</span><a href="#local-6989586621681134112"><span class="hs-identifier hs-var hs-var">fvs'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#filterNameSet"><span class="hs-identifier hs-var">filterNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681134114"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134113"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-718"></span><span>                </span><span class="hs-comment">-- Keep locally-defined Names</span><span>
</span><span id="line-719"></span><span>                </span><span class="hs-comment">-- As well as dependency analysis, we need these for the</span><span>
</span><span id="line-720"></span><span>                </span><span class="hs-comment">-- MonoLocalBinds test in GHC.Tc.Gen.Bind.decideGeneralisationPlan</span><span>
</span><span id="line-721"></span><span>
</span><span id="line-722"></span><span>              </span><span id="local-6989586621681134111"><span class="annot"><span class="annottext">bind' :: PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681134111"><span class="hs-identifier hs-var hs-var">bind'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcPs
</span><a href="#local-6989586621681134169"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">psb_args :: HsPatSynDetails (Located (IdP GhcRn))
</span><a href="GHC.Hs.Binds.html#psb_args"><span class="hs-identifier hs-var">psb_args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsConDetails (Located Name) [RecordPatSynField (Located Name)]
HsPatSynDetails (Located (IdP GhcRn))
</span><a href="#local-6989586621681134153"><span class="hs-identifier hs-var">details'</span></a></span><span>
</span><span id="line-723"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_def :: LPat GhcRn
</span><a href="GHC.Hs.Binds.html#psb_def"><span class="hs-identifier hs-var">psb_def</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located (Pat GhcRn)
LPat GhcRn
</span><a href="#local-6989586621681134154"><span class="hs-identifier hs-var">pat'</span></a></span><span>
</span><span id="line-724"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_dir :: HsPatSynDir GhcRn
</span><a href="GHC.Hs.Binds.html#psb_dir"><span class="hs-identifier hs-var">psb_dir</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsPatSynDir GhcRn
</span><a href="#local-6989586621681134123"><span class="hs-identifier hs-var">dir'</span></a></span><span>
</span><span id="line-725"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">psb_ext :: XPSB GhcRn GhcRn
</span><a href="GHC.Hs.Binds.html#psb_ext"><span class="hs-identifier hs-var">psb_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet
XPSB GhcRn GhcRn
</span><a href="#local-6989586621681134112"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-726"></span><span>              </span><span id="local-6989586621681134110"><span class="annot"><span class="annottext">selector_names :: [Name]
</span><a href="#local-6989586621681134110"><span class="hs-identifier hs-var hs-var">selector_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsConDetails (Located Name) [RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134153"><span class="hs-identifier hs-var">details'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-727"></span><span>                                 </span><span class="annot"><a href="GHC.Hs.Type.html#RecCon"><span class="hs-identifier hs-type">RecCon</span></a></span><span> </span><span id="local-6989586621681134109"><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134109"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-728"></span><span>                                  </span><span class="annot"><span class="annottext">(RecordPatSynField (Located Name) -&gt; Name)
-&gt; [RecordPatSynField (Located Name)] -&gt; [Name]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Located Name -&gt; Name)
-&gt; (RecordPatSynField (Located Name) -&gt; Located Name)
-&gt; RecordPatSynField (Located Name)
-&gt; Name
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RecordPatSynField (Located Name) -&gt; Located Name
forall a. RecordPatSynField a -&gt; a
</span><a href="GHC.Hs.Binds.html#recordPatSynSelectorId"><span class="hs-identifier hs-var hs-var">recordPatSynSelectorId</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RecordPatSynField (Located Name)]
</span><a href="#local-6989586621681134109"><span class="hs-identifier hs-var">names</span></a></span><span>
</span><span id="line-729"></span><span>                                 </span><span class="annot"><span class="annottext">HsConDetails (Located Name) [RecordPatSynField (Located Name)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-730"></span><span>
</span><span id="line-731"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134112"><span class="hs-identifier hs-var">fvs'</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
-&gt; RnM (PatSynBind GhcRn GhcRn, [Name], NameSet)
-&gt; RnM (PatSynBind GhcRn GhcRn, [Name], NameSet)
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="hs-comment">-- See Note [Free-variable space leak]</span><span>
</span><span id="line-732"></span><span>          </span><span class="annot"><span class="annottext">(PatSynBind GhcRn GhcRn, [Name], NameSet)
-&gt; RnM (PatSynBind GhcRn GhcRn, [Name], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PatSynBind GhcRn GhcRn
</span><a href="#local-6989586621681134111"><span class="hs-identifier hs-var">bind'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681134167"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Name -&gt; [Name] -&gt; [Name]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134110"><span class="hs-identifier hs-var">selector_names</span></a></span><span> </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134152"><span class="hs-identifier hs-var">fvs1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-733"></span><span>          </span><span class="hs-comment">-- Why fvs1?  See Note [Pattern synonym builders don't yield dependencies]</span><span>
</span><span id="line-734"></span><span>      </span><span class="hs-special">}</span><span>
</span><span id="line-735"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-736"></span><span>    </span><span class="hs-comment">-- See Note [Renaming pattern synonym variables]</span><span>
</span><span id="line-737"></span><span>    </span><span id="local-6989586621681134144"><span class="annot"><span class="annottext">lookupPatSynBndr :: Located RdrName -&gt; RnM (Located Name)
</span><a href="#local-6989586621681134144"><span class="hs-identifier hs-var hs-var">lookupPatSynBndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; TcM Name) -&gt; Located RdrName -&gt; RnM (Located Name)
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; TcM Name
</span><a href="GHC.Rename.Env.html#lookupLocalOccRn"><span class="hs-identifier hs-var">lookupLocalOccRn</span></a></span><span>
</span><span id="line-738"></span><span>
</span><span id="line-739"></span><span>    </span><span class="annot"><a href="#local-6989586621681134156"><span class="hs-identifier hs-type">patternSynonymErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-740"></span><span>    </span><span id="local-6989586621681134156"><span class="annot"><span class="annottext">patternSynonymErr :: MsgDoc
</span><a href="#local-6989586621681134156"><span class="hs-identifier hs-var hs-var">patternSynonymErr</span></a></span></span><span>
</span><span id="line-741"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Illegal pattern synonym declaration&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-742"></span><span>           </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Use -XPatternSynonyms to enable this extension&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-743"></span><span>
</span><span id="line-744"></span><span class="hs-comment">{-
Note [Renaming pattern synonym variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We rename pattern synonym declaractions backwards to normal to reuse
the logic already implemented for renaming patterns.

We first rename the RHS of a declaration which brings into
scope the variables bound by the pattern (as they would be
in normal function definitions). We then lookup the variables
which we want to bind in this local environment.

It is crucial that we then only lookup in the *local* environment which
only contains the variables brought into scope by the pattern and nothing
else. Amazingly no-one encountered this bug for 3 GHC versions but
it was possible to define a pattern synonym which referenced global
identifiers and worked correctly.

```
x = 5

pattern P :: Int -&gt; ()
pattern P x &lt;- _

f (P x) = x

&gt; f () = 5
```

See #13470 for the original report.

Note [Pattern synonym builders don't yield dependencies]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When renaming a pattern synonym that has an explicit builder,
references in the builder definition should not be used when
calculating dependencies. For example, consider the following pattern
synonym definition:

pattern P x &lt;- C1 x where
  P x = f (C1 x)

f (P x) = C2 x

In this case, 'P' needs to be typechecked in two passes:

1. Typecheck the pattern definition of 'P', which fully determines the
   type of 'P'. This step doesn't require knowing anything about 'f',
   since the builder definition is not looked at.

2. Typecheck the builder definition, which needs the typechecked
   definition of 'f' to be in scope; done by calls oo tcPatSynBuilderBind
   in GHC.Tc.Gen.Bind.tcValBinds.

This behaviour is implemented in 'tcValBinds', but it crucially
depends on 'P' not being put in a recursive group with 'f' (which
would make it look like a recursive pattern synonym a la 'pattern P =
P' which is unsound and rejected).

So:
 * We do not include builder fvs in the Uses returned by rnPatSynBind
   (which is then used for dependency analysis)
 * But we /do/ include them in the psb_fvs for the PatSynBind
 * In rnValBinds we record these builder uses, to avoid bogus
   unused-variable warnings (#12548)
-}</span><span>
</span><span id="line-809"></span><span>
</span><span id="line-810"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                Class/instance method bindings
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-815"></span><span>
</span><span id="line-816"></span><span class="hs-comment">{- @rnMethodBinds@ is used for the method bindings of a class and an instance
declaration.   Like @rnBinds@ but without dependency analysis.

NOTA BENE: we record each {\em binder} of a method-bind group as a free variable.
That's crucial when dealing with an instance decl:
\begin{verbatim}
        instance Foo (T a) where
           op x = ...
\end{verbatim}
This might be the {\em sole} occurrence of @op@ for an imported class @Foo@,
and unless @op@ occurs we won't treat the type signature of @op@ in the class
decl for @Foo@ as a source of instance-decl gates.  But we should!  Indeed,
in many ways the @op@ in an instance decl is just like an occurrence, not
a binder.
-}</span><span>
</span><span id="line-831"></span><span>
</span><span id="line-832"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnMethodBinds"><span class="hs-identifier hs-type">rnMethodBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                   </span><span class="hs-comment">-- True &lt;=&gt; is a class declaration</span><span>
</span><span id="line-833"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>                   </span><span class="hs-comment">-- Class name</span><span>
</span><span id="line-834"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>                 </span><span class="hs-comment">-- Type variables from the class/instance header</span><span>
</span><span id="line-835"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>         </span><span class="hs-comment">-- Binds</span><span>
</span><span id="line-836"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span>           </span><span class="hs-comment">-- and signatures/pragmas</span><span>
</span><span id="line-837"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-838"></span><span class="hs-comment">-- Used for</span><span>
</span><span id="line-839"></span><span class="hs-comment">--   * the default method bindings in a class decl</span><span>
</span><span id="line-840"></span><span class="hs-comment">--   * the method bindings in an instance decl</span><span>
</span><span id="line-841"></span><span id="rnMethodBinds"><span class="annot"><span class="annottext">rnMethodBinds :: Bool
-&gt; Name
-&gt; [Name]
-&gt; LHsBindsLR GhcPs GhcPs
-&gt; [LSig GhcPs]
-&gt; RnM (LHsBinds GhcRn, [LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#rnMethodBinds"><span class="hs-identifier hs-var hs-var">rnMethodBinds</span></a></span></span><span> </span><span id="local-6989586621681134107"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134107"><span class="hs-identifier hs-var">is_cls_decl</span></a></span></span><span> </span><span id="local-6989586621681134106"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134106"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span id="local-6989586621681134105"><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134105"><span class="hs-identifier hs-var">ktv_names</span></a></span></span><span> </span><span id="local-6989586621681134104"><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134104"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621681134103"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134103"><span class="hs-identifier hs-var">sigs</span></a></span></span><span>
</span><span id="line-842"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">[Located RdrName] -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkDupRdrNames"><span class="hs-identifier hs-var">checkDupRdrNames</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs -&gt; [Located (IdP GhcPs)]
forall idL idR. LHsBindsLR idL idR -&gt; [Located (IdP idL)]
</span><a href="GHC.Hs.Utils.html#collectMethodBinders"><span class="hs-identifier hs-var">collectMethodBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134104"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-843"></span><span>             </span><span class="hs-comment">-- Check that the same method is not given twice in the</span><span>
</span><span id="line-844"></span><span>             </span><span class="hs-comment">-- same instance decl      instance C T where</span><span>
</span><span id="line-845"></span><span>             </span><span class="hs-comment">--                       f x = ...</span><span>
</span><span id="line-846"></span><span>             </span><span class="hs-comment">--                       g y = ...</span><span>
</span><span id="line-847"></span><span>             </span><span class="hs-comment">--                       f x = ...</span><span>
</span><span id="line-848"></span><span>             </span><span class="hs-comment">-- We must use checkDupRdrNames because the Name of the</span><span>
</span><span id="line-849"></span><span>             </span><span class="hs-comment">-- method is the Name of the class selector, whose SrcSpan</span><span>
</span><span id="line-850"></span><span>             </span><span class="hs-comment">-- points to the class declaration; and we use rnMethodBinds</span><span>
</span><span id="line-851"></span><span>             </span><span class="hs-comment">-- for instance decls too</span><span>
</span><span id="line-852"></span><span>
</span><span id="line-853"></span><span>       </span><span class="hs-comment">-- Rename the bindings LHSs</span><span>
</span><span id="line-854"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134101"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134101"><span class="hs-identifier hs-var">binds'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located (HsBindLR GhcPs GhcPs)
 -&gt; LHsBindsLR GhcRn GhcPs
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs))
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; LHsBindsLR GhcPs GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; b -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Data.Foldable.html#foldrM"><span class="hs-identifier hs-var">foldrM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
-&gt; Name
-&gt; Located (HsBindLR GhcPs GhcPs)
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnMethodBindLHS"><span class="hs-identifier hs-var">rnMethodBindLHS</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134107"><span class="hs-identifier hs-var">is_cls_decl</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134106"><span class="hs-identifier hs-var">cls</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
forall a. Bag a
</span><a href="GHC.Data.Bag.html#emptyBag"><span class="hs-identifier hs-var">emptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcPs GhcPs
</span><a href="#local-6989586621681134104"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-855"></span><span>
</span><span id="line-856"></span><span>       </span><span class="hs-comment">-- Rename the pragmas and signatures</span><span>
</span><span id="line-857"></span><span>       </span><span class="hs-comment">-- Annoyingly the type variables /are/ in scope for signatures, but</span><span>
</span><span id="line-858"></span><span>       </span><span class="hs-comment">-- /are not/ in scope in the SPECIALISE instance pramas; e.g.</span><span>
</span><span id="line-859"></span><span>       </span><span class="hs-comment">--    instance Eq a =&gt; Eq (T a) where</span><span>
</span><span id="line-860"></span><span>       </span><span class="hs-comment">--       (==) :: a -&gt; a -&gt; a</span><span>
</span><span id="line-861"></span><span>       </span><span class="hs-comment">--       {-# SPECIALISE instance Eq a =&gt; Eq (T [a]) #-}</span><span>
</span><span id="line-862"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134097"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134097"><span class="hs-identifier hs-var">spec_inst_prags</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134096"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134096"><span class="hs-identifier hs-var">other_sigs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcPs -&gt; Bool)
-&gt; [LSig GhcPs] -&gt; ([LSig GhcPs], [LSig GhcPs])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcPs -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isSpecInstLSig"><span class="hs-identifier hs-var">isSpecInstLSig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134103"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-863"></span><span>             </span><span id="local-6989586621681134094"><span class="annot"><span class="annottext">bound_nms :: NameSet
</span><a href="#local-6989586621681134094"><span class="hs-identifier hs-var hs-var">bound_nms</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs -&gt; [IdP GhcRn]
forall p idR. CollectPass p =&gt; LHsBindsLR p idR -&gt; [IdP p]
</span><a href="GHC.Hs.Utils.html#collectHsBindsBinders"><span class="hs-identifier hs-var">collectHsBindsBinders</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134101"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-864"></span><span>             </span><span id="local-6989586621681134093"><span class="annot"><span class="annottext">sig_ctxt :: HsSigCtxt
</span><a href="#local-6989586621681134093"><span class="hs-identifier hs-var hs-var">sig_ctxt</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134107"><span class="hs-identifier hs-var">is_cls_decl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; HsSigCtxt
</span><a href="GHC.Rename.Env.html#ClsDeclCtxt"><span class="hs-identifier hs-var">ClsDeclCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134106"><span class="hs-identifier hs-var">cls</span></a></span><span>
</span><span id="line-865"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; HsSigCtxt
</span><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-var">InstDeclCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134094"><span class="hs-identifier hs-var">bound_nms</span></a></span><span>
</span><span id="line-866"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134090"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134090"><span class="hs-identifier hs-var">spec_inst_prags'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134089"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134089"><span class="hs-identifier hs-var">sip_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-var">renameSigs</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134093"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134097"><span class="hs-identifier hs-var">spec_inst_prags</span></a></span><span>
</span><span id="line-867"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134088"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134088"><span class="hs-identifier hs-var">other_sigs'</span></a></span></span><span class="hs-special">,</span><span>      </span><span id="local-6989586621681134087"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134087"><span class="hs-identifier hs-var">sig_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
-&gt; RnM ([LSig GhcRn], NameSet) -&gt; RnM ([LSig GhcRn], NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.Utils.html#extendTyVarEnvFVRn"><span class="hs-identifier hs-var">extendTyVarEnvFVRn</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134105"><span class="hs-identifier hs-var">ktv_names</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM ([LSig GhcRn], NameSet) -&gt; RnM ([LSig GhcRn], NameSet))
-&gt; RnM ([LSig GhcRn], NameSet) -&gt; RnM ([LSig GhcRn], NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-868"></span><span>                                        </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-var">renameSigs</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134093"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134096"><span class="hs-identifier hs-var">other_sigs</span></a></span><span>
</span><span id="line-869"></span><span>
</span><span id="line-870"></span><span>       </span><span class="hs-comment">-- Rename the bindings RHSs.  Again there's an issue about whether the</span><span>
</span><span id="line-871"></span><span>       </span><span class="hs-comment">-- type variables from the class/instance head are in scope.</span><span>
</span><span id="line-872"></span><span>       </span><span class="hs-comment">-- Answer no in Haskell 2010, but yes if you have -XScopedTypeVariables</span><span>
</span><span id="line-873"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134086"><span class="annot"><span class="annottext">LHsBinds GhcRn
</span><a href="#local-6989586621681134086"><span class="hs-identifier hs-var">binds''</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134085"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134085"><span class="hs-identifier hs-var">bind_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Name]
-&gt; RnM (LHsBinds GhcRn, NameSet) -&gt; RnM (LHsBinds GhcRn, NameSet)
forall a. [Name] -&gt; RnM (a, NameSet) -&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.HsType.html#bindSigTyVarsFV"><span class="hs-identifier hs-var">bindSigTyVarsFV</span></a></span><span> </span><span class="annot"><span class="annottext">[Name]
</span><a href="#local-6989586621681134105"><span class="hs-identifier hs-var">ktv_names</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM (LHsBinds GhcRn, NameSet) -&gt; RnM (LHsBinds GhcRn, NameSet))
-&gt; RnM (LHsBinds GhcRn, NameSet) -&gt; RnM (LHsBinds GhcRn, NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-874"></span><span>              </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134084"><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134084"><span class="hs-identifier hs-var">binds_w_dus</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet))
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (Bag (LHsBind GhcRn, [Name], NameSet))
forall (m :: * -&gt; *) a b.
Monad m =&gt;
(a -&gt; m b) -&gt; Bag a -&gt; m (Bag b)
</span><a href="GHC.Data.Bag.html#mapBagM"><span class="hs-identifier hs-var">mapBagM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Name -&gt; [Name])
-&gt; GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBind GhcRn, [Name], NameSet)
</span><a href="GHC.Rename.Bind.html#rnLBind"><span class="hs-identifier hs-var">rnLBind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LSig GhcRn] -&gt; Name -&gt; [Name]
</span><a href="GHC.Rename.Bind.html#mkScopedTvFn"><span class="hs-identifier hs-var">mkScopedTvFn</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134088"><span class="hs-identifier hs-var">other_sigs'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134101"><span class="hs-identifier hs-var">binds'</span></a></span><span>
</span><span id="line-875"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134083"><span class="annot"><span class="annottext">bind_fvs :: NameSet
</span><a href="#local-6989586621681134083"><span class="hs-identifier hs-var hs-var">bind_fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((LHsBind GhcRn, [Name], NameSet) -&gt; NameSet -&gt; NameSet)
-&gt; NameSet -&gt; Bag (LHsBind GhcRn, [Name], NameSet) -&gt; NameSet
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBind GhcRn
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681134082"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134082"><span class="hs-identifier hs-var">fv1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134081"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134081"><span class="hs-identifier hs-var">fv2</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134082"><span class="hs-identifier hs-var">fv1</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134081"><span class="hs-identifier hs-var">fv2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-876"></span><span>                                           </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134084"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span>
</span><span id="line-877"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsBinds GhcRn, NameSet) -&gt; RnM (LHsBinds GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((LHsBind GhcRn, [Name], NameSet) -&gt; LHsBind GhcRn)
-&gt; Bag (LHsBind GhcRn, [Name], NameSet) -&gt; LHsBinds GhcRn
forall a b. (a -&gt; b) -&gt; Bag a -&gt; Bag b
</span><a href="GHC.Data.Bag.html#mapBag"><span class="hs-identifier hs-var">mapBag</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsBind GhcRn, [Name], NameSet) -&gt; LHsBind GhcRn
forall a b c. (a, b, c) -&gt; a
</span><a href="GHC.Utils.Misc.html#fstOf3"><span class="hs-identifier hs-var">fstOf3</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (LHsBind GhcRn, [Name], NameSet)
</span><a href="#local-6989586621681134084"><span class="hs-identifier hs-var">binds_w_dus</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134083"><span class="hs-identifier hs-var">bind_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-878"></span><span>
</span><span id="line-879"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LHsBinds GhcRn, [LSig GhcRn], NameSet)
-&gt; RnM (LHsBinds GhcRn, [LSig GhcRn], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcRn
</span><a href="#local-6989586621681134086"><span class="hs-identifier hs-var">binds''</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134090"><span class="hs-identifier hs-var">spec_inst_prags'</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn] -&gt; [LSig GhcRn] -&gt; [LSig GhcRn]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134088"><span class="hs-identifier hs-var">other_sigs'</span></a></span><span>
</span><span id="line-880"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134087"><span class="hs-identifier hs-var">sig_fvs</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134089"><span class="hs-identifier hs-var">sip_fvs</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134085"><span class="hs-identifier hs-var">bind_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-881"></span><span>
</span><span id="line-882"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnMethodBindLHS"><span class="hs-identifier hs-type">rnMethodBindLHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-883"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBindLR"><span class="hs-identifier hs-type">LHsBindLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-884"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBindsLR"><span class="hs-identifier hs-type">LHsBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-885"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBindsLR"><span class="hs-identifier hs-type">LHsBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-886"></span><span id="rnMethodBindLHS"><span class="annot"><span class="annottext">rnMethodBindLHS :: Bool
-&gt; Name
-&gt; Located (HsBindLR GhcPs GhcPs)
-&gt; LHsBindsLR GhcRn GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
</span><a href="GHC.Rename.Bind.html#rnMethodBindLHS"><span class="hs-identifier hs-var hs-var">rnMethodBindLHS</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134078"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134078"><span class="hs-identifier hs-var">cls</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134077"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134077"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681134076"><span class="annot"><span class="annottext">bind :: HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134076"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681134075"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134075"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134074"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134074"><span class="hs-identifier hs-var">rest</span></a></span></span><span>
</span><span id="line-887"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134077"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs))
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-888"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134073"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134073"><span class="hs-identifier hs-var">sel_name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(RdrName -&gt; TcM Name) -&gt; Located RdrName -&gt; RnM (Located Name)
forall a b. (a -&gt; TcM b) -&gt; Located a -&gt; TcM (Located b)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocM"><span class="hs-identifier hs-var">wrapLocM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc -&gt; RdrName -&gt; TcM Name
</span><a href="GHC.Rename.Env.html#lookupInstDeclBndr"><span class="hs-identifier hs-var">lookupInstDeclBndr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681134078"><span class="hs-identifier hs-var">cls</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;method&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134075"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-889"></span><span>                     </span><span class="hs-comment">-- We use the selector name as the binder</span><span>
</span><span id="line-890"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134071"><span class="annot"><span class="annottext">bind' :: HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134071"><span class="hs-identifier hs-var hs-var">bind'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134076"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: Located (IdP GhcRn)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134073"><span class="hs-identifier hs-var">sel_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: XFunBind GhcRn GhcPs
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XFunBind GhcRn GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-891"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsBindLR GhcRn GhcPs
-&gt; GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134077"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcRn GhcPs
</span><a href="#local-6989586621681134071"><span class="hs-identifier hs-var">bind'</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBindLR GhcRn GhcPs)
-&gt; LHsBindsLR GhcRn GhcPs -&gt; LHsBindsLR GhcRn GhcPs
forall a. a -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#consBag"><span class="hs-operator hs-var">`consBag`</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134074"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-892"></span><span>
</span><span id="line-893"></span><span class="hs-comment">-- Report error for all other forms of bindings</span><span>
</span><span id="line-894"></span><span class="hs-comment">-- This is why we use a fold rather than map</span><span>
</span><span id="line-895"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnMethodBindLHS"><span class="hs-identifier hs-var">rnMethodBindLHS</span></a></span><span> </span><span id="local-6989586621681134069"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134069"><span class="hs-identifier hs-var">is_cls_decl</span></a></span></span><span> </span><span class="annot"><span class="annottext">Name
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681134068"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134068"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681134067"><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134067"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681134066"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134066"><span class="hs-identifier hs-var">rest</span></a></span></span><span>
</span><span id="line-896"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681134068"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-897"></span><span>         </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681134065"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not allowed in&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681134064"><span class="hs-identifier hs-var">decl_sort</span></a></span><span>
</span><span id="line-898"></span><span>              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134067"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-899"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (LHsBindsLR GhcRn GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681134066"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-900"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-901"></span><span>    </span><span id="local-6989586621681134064"><span class="annot"><span class="annottext">decl_sort :: MsgDoc
</span><a href="#local-6989586621681134064"><span class="hs-identifier hs-var hs-var">decl_sort</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134069"><span class="hs-identifier hs-var">is_cls_decl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;class declaration:&quot;</span></span><span>
</span><span id="line-902"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;instance declaration:&quot;</span></span><span>
</span><span id="line-903"></span><span>    </span><span id="local-6989586621681134065"><span class="annot"><span class="annottext">what :: MsgDoc
</span><a href="#local-6989586621681134065"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134067"><span class="hs-identifier hs-var">bind</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-904"></span><span>              </span><span class="annot"><a href="GHC.Hs.Binds.html#PatBind"><span class="hs-identifier hs-type">PatBind</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern bindings (except simple variables)&quot;</span></span><span>
</span><span id="line-905"></span><span>              </span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Pattern synonyms&quot;</span></span><span>
</span><span id="line-906"></span><span>                               </span><span class="hs-comment">-- Associated pattern synonyms are not implemented yet</span><span>
</span><span id="line-907"></span><span>              </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; MsgDoc
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnMethodBind&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBindLR GhcPs GhcPs
</span><a href="#local-6989586621681134067"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-908"></span><span>
</span><span id="line-909"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsubsection[dep-Sigs]{Signatures (and user-pragmas for values)}
*                                                                      *
************************************************************************

@renameSigs@ checks for:
\begin{enumerate}
\item more than one sig for one thing;
\item signatures given for things not bound here;
\end{enumerate}

At the moment we don't gather free-var info from the types in
signatures.  We'd only need this if we wanted to report unused tyvars.
-}</span><span>
</span><span id="line-925"></span><span>
</span><span id="line-926"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-type">renameSigs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier hs-type">HsSigCtxt</span></a></span><span>
</span><span id="line-927"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-928"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-929"></span><span class="hs-comment">-- Renames the signatures and performs error checks</span><span>
</span><span id="line-930"></span><span id="renameSigs"><span class="annot"><span class="annottext">renameSigs :: HsSigCtxt -&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
</span><a href="GHC.Rename.Bind.html#renameSigs"><span class="hs-identifier hs-var hs-var">renameSigs</span></a></span></span><span> </span><span id="local-6989586621681134062"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134062"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681134061"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134061"><span class="hs-identifier hs-var">sigs</span></a></span></span><span>
</span><span id="line-931"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">(NonEmpty (Located RdrName, Sig GhcPs) -&gt; TcRn ())
-&gt; [NonEmpty (Located RdrName, Sig GhcPs)] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Located RdrName, Sig GhcPs) -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#dupSigDeclErr"><span class="hs-identifier hs-var">dupSigDeclErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LSig GhcPs] -&gt; [NonEmpty (Located RdrName, Sig GhcPs)]
</span><a href="GHC.Rename.Bind.html#findDupSigs"><span class="hs-identifier hs-var">findDupSigs</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134061"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-932"></span><span>
</span><span id="line-933"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs] -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#checkDupMinimalSigs"><span class="hs-identifier hs-var">checkDupMinimalSigs</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134061"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-934"></span><span>
</span><span id="line-935"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134057"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134057"><span class="hs-identifier hs-var">sigs'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134056"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134056"><span class="hs-identifier hs-var">sig_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LSig GhcPs -&gt; RnM (LSig GhcRn, NameSet))
-&gt; [LSig GhcPs] -&gt; RnM ([LSig GhcRn], NameSet)
forall a b. (a -&gt; RnM (b, NameSet)) -&gt; [a] -&gt; RnM ([b], NameSet)
</span><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier hs-var">mapFvRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Sig GhcPs -&gt; TcM (Sig GhcRn, NameSet))
-&gt; LSig GhcPs -&gt; RnM (LSig GhcRn, NameSet)
forall a b c. (a -&gt; TcM (b, c)) -&gt; Located a -&gt; TcM (Located b, c)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocFstM"><span class="hs-identifier hs-var">wrapLocFstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; TcM (Sig GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134062"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681134061"><span class="hs-identifier hs-var">sigs</span></a></span><span>
</span><span id="line-936"></span><span>
</span><span id="line-937"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134054"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134054"><span class="hs-identifier hs-var">good_sigs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134053"><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134053"><span class="hs-identifier hs-var">bad_sigs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; Bool)
-&gt; [LSig GhcRn] -&gt; ([LSig GhcRn], [LSig GhcRn])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; LSig GhcRn -&gt; Bool
forall (a :: Pass). HsSigCtxt -&gt; LSig (GhcPass a) -&gt; Bool
</span><a href="GHC.Rename.Bind.html#okHsSig"><span class="hs-identifier hs-var">okHsSig</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134062"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134057"><span class="hs-identifier hs-var">sigs'</span></a></span><span>
</span><span id="line-938"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(LSig GhcRn -&gt; TcRn ()) -&gt; [LSig GhcRn] -&gt; TcRn ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcRn -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#misplacedSigErr"><span class="hs-identifier hs-var">misplacedSigErr</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134053"><span class="hs-identifier hs-var">bad_sigs</span></a></span><span>                 </span><span class="hs-comment">-- Misplaced</span><span>
</span><span id="line-939"></span><span>
</span><span id="line-940"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LSig GhcRn], NameSet) -&gt; RnM ([LSig GhcRn], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LSig GhcRn]
</span><a href="#local-6989586621681134054"><span class="hs-identifier hs-var">good_sigs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134056"><span class="hs-identifier hs-var">sig_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-941"></span><span>
</span><span id="line-942"></span><span class="hs-comment">----------------------</span><span>
</span><span id="line-943"></span><span class="hs-comment">-- We use lookupSigOccRn in the signatures, which is a little bit unsatisfactory</span><span>
</span><span id="line-944"></span><span class="hs-comment">-- because this won't work for:</span><span>
</span><span id="line-945"></span><span class="hs-comment">--      instance Foo T where</span><span>
</span><span id="line-946"></span><span class="hs-comment">--        {-# INLINE op #-}</span><span>
</span><span id="line-947"></span><span class="hs-comment">--        Baz.op = ...</span><span>
</span><span id="line-948"></span><span class="hs-comment">-- We'll just rename the INLINE prag to refer to whatever other 'op'</span><span>
</span><span id="line-949"></span><span class="hs-comment">-- is in scope.  (I'm assuming that Baz.op isn't in scope unqualified.)</span><span>
</span><span id="line-950"></span><span class="hs-comment">-- Doesn't seem worth much trouble to sort this.</span><span>
</span><span id="line-951"></span><span>
</span><span id="line-952"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-type">renameSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier hs-type">HsSigCtxt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-953"></span><span id="renameSig"><span class="annot"><span class="annottext">renameSig :: HsSigCtxt -&gt; Sig GhcPs -&gt; TcM (Sig GhcRn, NameSet)
</span><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var hs-var">renameSig</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-type">IdSig</span></a></span><span> </span><span class="annot"><span class="annottext">XIdSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134049"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681134049"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-954"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XIdSig GhcRn -&gt; Id -&gt; Sig GhcRn
forall pass. XIdSig pass -&gt; Id -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-var">IdSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XIdSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681134049"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- Actually this never occurs</span><span>
</span><span id="line-955"></span><span>
</span><span id="line-956"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681134048"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134048"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681134047"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681134047"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">XTypeSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134046"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134046"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span id="local-6989586621681134045"><span class="annot"><span class="annottext">LHsSigWcType GhcPs
</span><a href="#local-6989586621681134045"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-957"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134044"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681134044"><span class="hs-identifier hs-var">new_vs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134048"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681134047"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134046"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-958"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681134042"><span class="annot"><span class="annottext">doc :: HsDocContext
</span><a href="#local-6989586621681134042"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; HsDocContext
</span><a href="GHC.Rename.Utils.html#TypeSigCtx"><span class="hs-identifier hs-var">TypeSigCtx</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Located RdrName] -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#ppr_sig_bndrs"><span class="hs-identifier hs-var">ppr_sig_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134046"><span class="hs-identifier hs-var">vs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-959"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134039"><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681134039"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134038"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134038"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; LHsSigWcType GhcPs -&gt; RnM (LHsSigWcType GhcRn, NameSet)
</span><a href="GHC.Rename.HsType.html#rnHsSigWcType"><span class="hs-identifier hs-var">rnHsSigWcType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681134042"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcPs
</span><a href="#local-6989586621681134045"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-960"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XTypeSig GhcRn
-&gt; [Located (IdP GhcRn)] -&gt; LHsSigWcType GhcRn -&gt; Sig GhcRn
forall pass.
XTypeSig pass
-&gt; [Located (IdP pass)] -&gt; LHsSigWcType pass -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-var">TypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XTypeSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134044"><span class="hs-identifier hs-var">new_vs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType GhcRn
</span><a href="#local-6989586621681134039"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134038"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-961"></span><span>
</span><span id="line-962"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681134036"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134036"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681134035"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681134035"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134034"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134034"><span class="hs-identifier hs-var">is_deflt</span></a></span></span><span> </span><span id="local-6989586621681134033"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134033"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span id="local-6989586621681134032"><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681134032"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-963"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134031"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134031"><span class="hs-identifier hs-var">defaultSigs_on</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#DefaultSignatures"><span class="hs-identifier hs-var">LangExt.DefaultSignatures</span></a></span><span>
</span><span id="line-964"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134034"><span class="hs-identifier hs-var">is_deflt</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134031"><span class="hs-identifier hs-var">defaultSigs_on</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-965"></span><span>          </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#defaultSigErr"><span class="hs-identifier hs-var">defaultSigErr</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681134035"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-966"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681134028"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681134028"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134036"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681134035"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134033"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-967"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134027"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134027"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134026"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134026"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; TypeOrKind
-&gt; LHsSigType GhcPs
-&gt; RnM (LHsSigType GhcRn, NameSet)
</span><a href="GHC.Rename.HsType.html#rnHsSigType"><span class="hs-identifier hs-var">rnHsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681134024"><span class="hs-identifier hs-var">ty_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TypeOrKind
</span><a href="GHC.Types.Basic.html#TypeLevel"><span class="hs-identifier hs-var">TypeLevel</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681134032"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-968"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XClassOpSig GhcRn
-&gt; Bool -&gt; [Located (IdP GhcRn)] -&gt; LHsSigType GhcRn -&gt; Sig GhcRn
forall pass.
XClassOpSig pass
-&gt; Bool -&gt; [Located (IdP pass)] -&gt; LHsSigType pass -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-var">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XClassOpSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681134034"><span class="hs-identifier hs-var">is_deflt</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681134028"><span class="hs-identifier hs-var">new_v</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134027"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134026"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-969"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-970"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681134022"><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134022"><span class="hs-identifier hs-var">v1</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[Located RdrName]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681134033"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-971"></span><span>    </span><span id="local-6989586621681134024"><span class="annot"><span class="annottext">ty_ctxt :: HsDocContext
</span><a href="#local-6989586621681134024"><span class="hs-identifier hs-var hs-var">ty_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; HsDocContext
</span><a href="GHC.Rename.Utils.html#GenericCtx"><span class="hs-identifier hs-var">GenericCtx</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a class method signature for&quot;</span></span><span>
</span><span id="line-972"></span><span>                          </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
</span><a href="#local-6989586621681134022"><span class="hs-identifier hs-var">v1</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-973"></span><span>
</span><span id="line-974"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecInstSig"><span class="hs-identifier hs-type">SpecInstSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSpecInstSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134019"><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681134019"><span class="hs-identifier hs-var">src</span></a></span></span><span> </span><span id="local-6989586621681134018"><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681134018"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-975"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; Maybe MsgDoc -&gt; LHsSigType GhcPs -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#checkInferredVars"><span class="hs-identifier hs-var">checkInferredVars</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681134017"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe MsgDoc
</span><a href="#local-6989586621681134016"><span class="hs-identifier hs-var">inf_msg</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681134018"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-976"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134015"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134015"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134014"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134014"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; TypeOrKind
-&gt; LHsSigType GhcPs
-&gt; RnM (LHsSigType GhcRn, NameSet)
</span><a href="GHC.Rename.HsType.html#rnHsSigType"><span class="hs-identifier hs-var">rnHsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681134017"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">TypeOrKind
</span><a href="GHC.Types.Basic.html#TypeLevel"><span class="hs-identifier hs-var">TypeLevel</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681134018"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-977"></span><span>          </span><span class="hs-comment">-- Check if there are any nested `forall`s or contexts, which are</span><span>
</span><span id="line-978"></span><span>          </span><span class="hs-comment">-- illegal in the type of an instance declaration (see</span><span>
</span><span id="line-979"></span><span>          </span><span class="hs-comment">-- Note [No nested foralls or contexts in instance types] in</span><span>
</span><span id="line-980"></span><span>          </span><span class="hs-comment">-- GHC.Hs.Type).</span><span>
</span><span id="line-981"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsDocContext -&gt; MsgDoc -&gt; LHsType GhcRn -&gt; TcRn ()
</span><a href="GHC.Rename.Utils.html#addNoNestedForallsContextsErr"><span class="hs-identifier hs-var">addNoNestedForallsContextsErr</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681134017"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SPECIALISE instance type&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-982"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; LHsType GhcRn
forall (p :: Pass). LHsSigType (GhcPass p) -&gt; LHsType (GhcPass p)
</span><a href="GHC.Hs.Type.html#getLHsInstDeclHead"><span class="hs-identifier hs-var">getLHsInstDeclHead</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134015"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-983"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSpecInstSig GhcRn -&gt; SourceText -&gt; LHsSigType GhcRn -&gt; Sig GhcRn
forall pass.
XSpecInstSig pass -&gt; SourceText -&gt; LHsSigType pass -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#SpecInstSig"><span class="hs-identifier hs-var">SpecInstSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpecInstSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681134019"><span class="hs-identifier hs-var">src</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681134015"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134014"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-984"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-985"></span><span>    </span><span id="local-6989586621681134017"><span class="annot"><span class="annottext">doc :: HsDocContext
</span><a href="#local-6989586621681134017"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#SpecInstSigCtx"><span class="hs-identifier hs-var">SpecInstSigCtx</span></a></span><span>
</span><span id="line-986"></span><span>    </span><span id="local-6989586621681134016"><span class="annot"><span class="annottext">inf_msg :: Maybe MsgDoc
</span><a href="#local-6989586621681134016"><span class="hs-identifier hs-var hs-var">inf_msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Maybe MsgDoc
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Inferred type variables are not allowed&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-987"></span><span>
</span><span id="line-988"></span><span class="hs-comment">-- {-# SPECIALISE #-} pragmas can refer to imported Ids</span><span>
</span><span id="line-989"></span><span class="hs-comment">-- so, in the top-level case (when mb_names is Nothing)</span><span>
</span><span id="line-990"></span><span class="hs-comment">-- we use lookupOccRn.  If there's both an imported and a local 'f'</span><span>
</span><span id="line-991"></span><span class="hs-comment">-- then the SPECIALISE pragma is ambiguous, unlike all other signatures</span><span>
</span><span id="line-992"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681134011"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134011"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681134010"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681134010"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSpecSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681134008"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681134008"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681134007"><span class="annot"><span class="annottext">[LHsSigType GhcPs]
</span><a href="#local-6989586621681134007"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span id="local-6989586621681134006"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681134006"><span class="hs-identifier hs-var">inl</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-993"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681134005"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681134005"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134011"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-994"></span><span>                     </span><span class="annot"><a href="GHC.Rename.Env.html#TopSigCtxt"><span class="hs-identifier hs-type">TopSigCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupLocatedOccRn"><span class="hs-identifier hs-var">lookupLocatedOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134008"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-995"></span><span>                     </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681134011"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681134010"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134008"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-996"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681134002"><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681134002"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681134001"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134001"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(([LHsSigType GhcRn], NameSet)
 -&gt; LHsSigType GhcPs
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsSigType GhcRn], NameSet))
-&gt; ([LHsSigType GhcRn], NameSet)
-&gt; [LHsSigType GhcPs]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsSigType GhcRn], NameSet)
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">([LHsSigType GhcRn], NameSet)
-&gt; LHsSigType GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsSigType GhcRn], NameSet)
</span><a href="#local-6989586621681133999"><span class="hs-identifier hs-var">do_one</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LHsSigType GhcPs]
</span><a href="#local-6989586621681134007"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-997"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSpecSig GhcRn
-&gt; Located (IdP GhcRn)
-&gt; [LHsSigType GhcRn]
-&gt; InlinePragma
-&gt; Sig GhcRn
forall pass.
XSpecSig pass
-&gt; Located (IdP pass)
-&gt; [LHsSigType pass]
-&gt; InlinePragma
-&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-var">SpecSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpecSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681134005"><span class="hs-identifier hs-var">new_v</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681134002"><span class="hs-identifier hs-var">new_ty</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681134006"><span class="hs-identifier hs-var">inl</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681134001"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-998"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-999"></span><span>    </span><span id="local-6989586621681133998"><span class="annot"><span class="annottext">ty_ctxt :: HsDocContext
</span><a href="#local-6989586621681133998"><span class="hs-identifier hs-var hs-var">ty_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; HsDocContext
</span><a href="GHC.Rename.Utils.html#GenericCtx"><span class="hs-identifier hs-var">GenericCtx</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a SPECIALISE signature for&quot;</span></span><span>
</span><span id="line-1000"></span><span>                          </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681134008"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1001"></span><span>    </span><span id="local-6989586621681133999"><span class="annot"><span class="annottext">do_one :: ([LHsSigType GhcRn], NameSet)
-&gt; LHsSigType GhcPs
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsSigType GhcRn], NameSet)
</span><a href="#local-6989586621681133999"><span class="hs-identifier hs-var hs-var">do_one</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681133997"><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681133997"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681133996"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133996"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681133995"><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681133995"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1002"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681133994"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681133994"><span class="hs-identifier hs-var">new_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133993"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133993"><span class="hs-identifier hs-var">fvs_ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; TypeOrKind
-&gt; LHsSigType GhcPs
-&gt; RnM (LHsSigType GhcRn, NameSet)
</span><a href="GHC.Rename.HsType.html#rnHsSigType"><span class="hs-identifier hs-var">rnHsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681133998"><span class="hs-identifier hs-var">ty_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TypeOrKind
</span><a href="GHC.Types.Basic.html#TypeLevel"><span class="hs-identifier hs-var">TypeLevel</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681133995"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1003"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LHsSigType GhcRn], NameSet)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ([LHsSigType GhcRn], NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681133994"><span class="hs-identifier hs-var">new_ty</span></a></span><span class="annot"><span class="annottext">LHsSigType GhcRn -&gt; [LHsSigType GhcRn] -&gt; [LHsSigType GhcRn]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[LHsSigType GhcRn]
</span><a href="#local-6989586621681133997"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133993"><span class="hs-identifier hs-var">fvs_ty</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet -&gt; NameSet -&gt; NameSet
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133996"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1004"></span><span>
</span><span id="line-1005"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133992"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133992"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133991"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681133991"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="annot"><span class="annottext">XInlineSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133989"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681133989"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681133988"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681133988"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1006"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133987"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681133987"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133992"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133991"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681133989"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-1007"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XInlineSig GhcRn
-&gt; Located (IdP GhcRn) -&gt; InlinePragma -&gt; Sig GhcRn
forall pass.
XInlineSig pass -&gt; Located (IdP pass) -&gt; InlinePragma -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-var">InlineSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XInlineSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681133987"><span class="hs-identifier hs-var">new_v</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681133988"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1008"></span><span>
</span><span id="line-1009"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133986"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133986"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133985"><span class="annot"><span class="annottext">FixitySig GhcPs
</span><a href="#local-6989586621681133985"><span class="hs-identifier hs-var">fsig</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1010"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133984"><span class="annot"><span class="annottext">FixitySig GhcRn
</span><a href="#local-6989586621681133984"><span class="hs-identifier hs-var">new_fsig</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; FixitySig GhcPs -&gt; RnM (FixitySig GhcRn)
</span><a href="GHC.Rename.Bind.html#rnSrcFixityDecl"><span class="hs-identifier hs-var">rnSrcFixityDecl</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133986"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">FixitySig GhcPs
</span><a href="#local-6989586621681133985"><span class="hs-identifier hs-var">fsig</span></a></span><span>
</span><span id="line-1011"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XFixSig GhcRn -&gt; FixitySig GhcRn -&gt; Sig GhcRn
forall pass. XFixSig pass -&gt; FixitySig pass -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-var">FixSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XFixSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">FixitySig GhcRn
</span><a href="#local-6989586621681133984"><span class="hs-identifier hs-var">new_fsig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1012"></span><span>
</span><span id="line-1013"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133983"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133983"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133982"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681133982"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#MinimalSig"><span class="hs-identifier hs-type">MinimalSig</span></a></span><span> </span><span class="annot"><span class="annottext">XMinimalSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133980"><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133980"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133979"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133979"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681133978"><span class="annot"><span class="annottext">BooleanFormula (Located (IdP GhcPs))
</span><a href="#local-6989586621681133978"><span class="hs-identifier hs-var">bf</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1014"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681133977"><span class="annot"><span class="annottext">BooleanFormula (Located Name)
</span><a href="#local-6989586621681133977"><span class="hs-identifier hs-var">new_bf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; BooleanFormula (Located RdrName)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (BooleanFormula (Located Name))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133983"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133982"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">BooleanFormula (Located RdrName)
BooleanFormula (Located (IdP GhcPs))
</span><a href="#local-6989586621681133978"><span class="hs-identifier hs-var">bf</span></a></span><span>
</span><span id="line-1015"></span><span>       </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XMinimalSig GhcRn
-&gt; SourceText -&gt; LBooleanFormula (Located (IdP GhcRn)) -&gt; Sig GhcRn
forall pass.
XMinimalSig pass
-&gt; SourceText -&gt; LBooleanFormula (Located (IdP pass)) -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#MinimalSig"><span class="hs-identifier hs-var">MinimalSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XMinimalSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133980"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; BooleanFormula (Located Name)
-&gt; GenLocated SrcSpan (BooleanFormula (Located Name))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133979"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">BooleanFormula (Located Name)
</span><a href="#local-6989586621681133977"><span class="hs-identifier hs-var">new_bf</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1016"></span><span>
</span><span id="line-1017"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133975"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133975"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133974"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681133974"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133973"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133973"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span id="local-6989586621681133972"><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681133972"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1018"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133971"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681133971"><span class="hs-identifier hs-var">new_vs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133975"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133974"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133973"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-1019"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681133970"><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681133970"><span class="hs-identifier hs-var">ty'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133969"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133969"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; TypeOrKind
-&gt; LHsSigType GhcPs
-&gt; RnM (LHsSigType GhcRn, NameSet)
</span><a href="GHC.Rename.HsType.html#rnHsSigType"><span class="hs-identifier hs-var">rnHsSigType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681133968"><span class="hs-identifier hs-var">ty_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">TypeOrKind
</span><a href="GHC.Types.Basic.html#TypeLevel"><span class="hs-identifier hs-var">TypeLevel</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcPs
</span><a href="#local-6989586621681133972"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1020"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPatSynSig GhcRn
-&gt; [Located (IdP GhcRn)] -&gt; LHsSigType GhcRn -&gt; Sig GhcRn
forall pass.
XPatSynSig pass
-&gt; [Located (IdP pass)] -&gt; LHsSigType pass -&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-var">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XPatSynSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681133971"><span class="hs-identifier hs-var">new_vs</span></a></span><span> </span><span class="annot"><span class="annottext">LHsSigType GhcRn
</span><a href="#local-6989586621681133970"><span class="hs-identifier hs-var">ty'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133969"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1021"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1022"></span><span>    </span><span id="local-6989586621681133968"><span class="annot"><span class="annottext">ty_ctxt :: HsDocContext
</span><a href="#local-6989586621681133968"><span class="hs-identifier hs-var hs-var">ty_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; HsDocContext
</span><a href="GHC.Rename.Utils.html#GenericCtx"><span class="hs-identifier hs-var">GenericCtx</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;a pattern synonym signature for&quot;</span></span><span>
</span><span id="line-1023"></span><span>                          </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName] -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#ppr_sig_bndrs"><span class="hs-identifier hs-var">ppr_sig_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133973"><span class="hs-identifier hs-var">vs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1024"></span><span>
</span><span id="line-1025"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133967"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133967"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133966"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681133966"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSCCFunSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133964"><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133964"><span class="hs-identifier hs-var">st</span></a></span></span><span> </span><span id="local-6989586621681133963"><span class="annot"><span class="annottext">Located (IdP GhcPs)
</span><a href="#local-6989586621681133963"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621681133962"><span class="annot"><span class="annottext">Maybe (Located StringLiteral)
</span><a href="#local-6989586621681133962"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1026"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133961"><span class="annot"><span class="annottext">Located Name
</span><a href="#local-6989586621681133961"><span class="hs-identifier hs-var">new_v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; Sig GhcPs -&gt; Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupSigOccRn"><span class="hs-identifier hs-var">lookupSigOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133967"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133966"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName
Located (IdP GhcPs)
</span><a href="#local-6989586621681133963"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-1027"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSCCFunSig GhcRn
-&gt; SourceText
-&gt; Located (IdP GhcRn)
-&gt; Maybe (Located StringLiteral)
-&gt; Sig GhcRn
forall pass.
XSCCFunSig pass
-&gt; SourceText
-&gt; Located (IdP pass)
-&gt; Maybe (Located StringLiteral)
-&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-var">SCCFunSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSCCFunSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133964"><span class="hs-identifier hs-var">st</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name
Located (IdP GhcRn)
</span><a href="#local-6989586621681133961"><span class="hs-identifier hs-var">new_v</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located StringLiteral)
</span><a href="#local-6989586621681133962"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1028"></span><span>
</span><span id="line-1029"></span><span class="hs-comment">-- COMPLETE Sigs can refer to imported IDs which is why we use</span><span>
</span><span id="line-1030"></span><span class="hs-comment">-- lookupLocatedOccRn rather than lookupSigOccRn</span><span>
</span><span id="line-1031"></span><span class="annot"><a href="GHC.Rename.Bind.html#renameSig"><span class="hs-identifier hs-var">renameSig</span></a></span><span> </span><span id="local-6989586621681133960"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133960"><span class="hs-identifier hs-var">_ctxt</span></a></span></span><span> </span><span id="local-6989586621681133959"><span class="annot"><span class="annottext">sig :: Sig GhcPs
</span><a href="#local-6989586621681133959"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#CompleteMatchSig"><span class="hs-identifier hs-type">CompleteMatchSig</span></a></span><span> </span><span class="annot"><span class="annottext">XCompleteMatchSig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133957"><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133957"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133956"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133956"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681133955"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133955"><span class="hs-identifier hs-var">bf</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681133954"><span class="annot"><span class="annottext">Maybe (Located (IdP GhcPs))
</span><a href="#local-6989586621681133954"><span class="hs-identifier hs-var">mty</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1032"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681133953"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681133953"><span class="hs-identifier hs-var">new_bf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupLocatedOccRn"><span class="hs-identifier hs-var">lookupLocatedOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133955"><span class="hs-identifier hs-var">bf</span></a></span><span>
</span><span id="line-1033"></span><span>       </span><span id="local-6989586621681133952"><span class="annot"><span class="annottext">Maybe (Located Name)
</span><a href="#local-6989586621681133952"><span class="hs-identifier hs-var">new_mty</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; RnM (Located Name))
-&gt; Maybe (Located RdrName)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (Maybe (Located Name))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM (Located Name)
</span><a href="GHC.Rename.Env.html#lookupLocatedOccRn"><span class="hs-identifier hs-var">lookupLocatedOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (Located RdrName)
Maybe (Located (IdP GhcPs))
</span><a href="#local-6989586621681133954"><span class="hs-identifier hs-var">mty</span></a></span><span>
</span><span id="line-1034"></span><span>
</span><span id="line-1035"></span><span>       </span><span id="local-6989586621681133951"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681133951"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TcGblEnv -&gt; Module)
-&gt; IOEnv (Env TcGblEnv TcLclEnv) TcGblEnv
-&gt; IOEnv (Env TcGblEnv TcLclEnv) Module
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; Module
</span><a href="GHC.Tc.Types.html#tcg_mod"><span class="hs-identifier hs-var hs-var">tcg_mod</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-1036"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located Name -&gt; Bool) -&gt; [Located Name] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#any"><span class="hs-identifier hs-var">any</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681133951"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">(Name -&gt; Bool) -&gt; (Located Name -&gt; Name) -&gt; Located Name -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Located Name -&gt; Name
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681133953"><span class="hs-identifier hs-var">new_bf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1037"></span><span>         </span><span class="hs-comment">-- Why 'any'? See Note [Orphan COMPLETE pragmas]</span><span>
</span><span id="line-1038"></span><span>         </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn () -&gt; TcRn ()
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133959"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn () -&gt; TcRn ()) -&gt; TcRn () -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
forall a. MsgDoc -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681133945"><span class="hs-identifier hs-var">orphanError</span></a></span><span>
</span><span id="line-1039"></span><span>
</span><span id="line-1040"></span><span>       </span><span class="annot"><span class="annottext">(Sig GhcRn, NameSet) -&gt; TcM (Sig GhcRn, NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCompleteMatchSig GhcRn
-&gt; SourceText
-&gt; Located [Located (IdP GhcRn)]
-&gt; Maybe (Located (IdP GhcRn))
-&gt; Sig GhcRn
forall pass.
XCompleteMatchSig pass
-&gt; SourceText
-&gt; Located [Located (IdP pass)]
-&gt; Maybe (Located (IdP pass))
-&gt; Sig pass
</span><a href="GHC.Hs.Binds.html#CompleteMatchSig"><span class="hs-identifier hs-var">CompleteMatchSig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCompleteMatchSig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><a href="#local-6989586621681133957"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; [Located Name] -&gt; GenLocated SrcSpan [Located Name]
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133956"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681133953"><span class="hs-identifier hs-var">new_bf</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe (Located Name)
Maybe (Located (IdP GhcRn))
</span><a href="#local-6989586621681133952"><span class="hs-identifier hs-var">new_mty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1041"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1042"></span><span>    </span><span class="annot"><a href="#local-6989586621681133945"><span class="hs-identifier hs-type">orphanError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1043"></span><span>    </span><span id="local-6989586621681133945"><span class="annot"><span class="annottext">orphanError :: MsgDoc
</span><a href="#local-6989586621681133945"><span class="hs-identifier hs-var hs-var">orphanError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1044"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Orphan COMPLETE pragmas not supported&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1045"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A COMPLETE pragma must mention at least one data constructor&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-1046"></span><span>      </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;or pattern synonym defined in the same module.&quot;</span></span><span>
</span><span id="line-1047"></span><span>
</span><span id="line-1048"></span><span class="hs-comment">{-
Note [Orphan COMPLETE pragmas]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We define a COMPLETE pragma to be a non-orphan if it includes at least
one conlike defined in the current module. Why is this sufficient?
Well if you have a pattern match

  case expr of
    P1 -&gt; ...
    P2 -&gt; ...
    P3 -&gt; ...

any COMPLETE pragma which mentions a conlike other than P1, P2 or P3
will not be of any use in verifying that the pattern match is
exhaustive. So as we have certainly read the interface files that
define P1, P2 and P3, we will have loaded all non-orphan COMPLETE
pragmas that could be relevant to this pattern match.

For now we simply disallow orphan COMPLETE pragmas, as the added
complexity of supporting them properly doesn't seem worthwhile.
-}</span><span>
</span><span id="line-1069"></span><span>
</span><span id="line-1070"></span><span class="annot"><a href="GHC.Rename.Bind.html#ppr_sig_bndrs"><span class="hs-identifier hs-type">ppr_sig_bndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1071"></span><span id="ppr_sig_bndrs"><span class="annot"><span class="annottext">ppr_sig_bndrs :: [Located RdrName] -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#ppr_sig_bndrs"><span class="hs-identifier hs-var hs-var">ppr_sig_bndrs</span></a></span></span><span> </span><span id="local-6989586621681133943"><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681133943"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Located RdrName -&gt; MsgDoc) -&gt; [Located RdrName] -&gt; MsgDoc
forall a. (a -&gt; MsgDoc) -&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#pprWithCommas"><span class="hs-identifier hs-var">pprWithCommas</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
</span><a href="#local-6989586621681133943"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1072"></span><span>
</span><span id="line-1073"></span><span id="local-6989586621681134896"><span class="annot"><a href="GHC.Rename.Bind.html#okHsSig"><span class="hs-identifier hs-type">okHsSig</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier hs-type">HsSigCtxt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPass"><span class="hs-identifier hs-type">GhcPass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681134896"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span></span><span>
</span><span id="line-1074"></span><span id="okHsSig"><span class="annot"><span class="annottext">okHsSig :: forall (a :: Pass). HsSigCtxt -&gt; LSig (GhcPass a) -&gt; Bool
</span><a href="GHC.Rename.Bind.html#okHsSig"><span class="hs-identifier hs-var hs-var">okHsSig</span></a></span></span><span> </span><span id="local-6989586621681133942"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133942"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133941"><span class="annot"><span class="annottext">Sig (GhcPass a)
</span><a href="#local-6989586621681133941"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1075"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig (GhcPass a)
</span><a href="#local-6989586621681133941"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133942"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1076"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#ClsDeclCtxt"><span class="hs-identifier hs-type">ClsDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1077"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1078"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1079"></span><span>
</span><span id="line-1080"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#ClsDeclCtxt"><span class="hs-identifier hs-type">ClsDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1081"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1082"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1083"></span><span>
</span><span id="line-1084"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#TopSigCtxt"><span class="hs-identifier hs-type">TopSigCtxt</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1085"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1086"></span><span>
</span><span id="line-1087"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1088"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1089"></span><span>
</span><span id="line-1090"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-type">IdSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#TopSigCtxt"><span class="hs-identifier hs-type">TopSigCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1091"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-type">IdSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1092"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#IdSig"><span class="hs-identifier hs-type">IdSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1093"></span><span>
</span><span id="line-1094"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsBootCtxt"><span class="hs-identifier hs-type">HsBootCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1095"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1096"></span><span>
</span><span id="line-1097"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#TopSigCtxt"><span class="hs-identifier hs-type">TopSigCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1098"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#LocalBindCtxt"><span class="hs-identifier hs-type">LocalBindCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1099"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1100"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecSig"><span class="hs-identifier hs-type">SpecSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1101"></span><span>
</span><span id="line-1102"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecInstSig"><span class="hs-identifier hs-type">SpecInstSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#InstDeclCtxt"><span class="hs-identifier hs-type">InstDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1103"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecInstSig"><span class="hs-identifier hs-type">SpecInstSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1104"></span><span>
</span><span id="line-1105"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#MinimalSig"><span class="hs-identifier hs-type">MinimalSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#ClsDeclCtxt"><span class="hs-identifier hs-type">ClsDeclCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1106"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#MinimalSig"><span class="hs-identifier hs-type">MinimalSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1107"></span><span>
</span><span id="line-1108"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsBootCtxt"><span class="hs-identifier hs-type">HsBootCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1109"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1110"></span><span>
</span><span id="line-1111"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#CompleteMatchSig"><span class="hs-identifier hs-type">CompleteMatchSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#TopSigCtxt"><span class="hs-identifier hs-type">TopSigCtxt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1112"></span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#CompleteMatchSig"><span class="hs-identifier hs-type">CompleteMatchSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1113"></span><span>
</span><span id="line-1114"></span><span class="hs-comment">-------------------</span><span>
</span><span id="line-1115"></span><span class="annot"><a href="GHC.Rename.Bind.html#findDupSigs"><span class="hs-identifier hs-type">findDupSigs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1116"></span><span class="hs-comment">-- Check for duplicates on RdrName version,</span><span>
</span><span id="line-1117"></span><span class="hs-comment">-- because renamed version has unboundName for</span><span>
</span><span id="line-1118"></span><span class="hs-comment">-- not-in-scope binders, which gives bogus dup-sig errors</span><span>
</span><span id="line-1119"></span><span class="hs-comment">-- NB: in a class decl, a 'generic' sig is not considered</span><span>
</span><span id="line-1120"></span><span class="hs-comment">--     equal to an ordinary sig, so we allow, say</span><span>
</span><span id="line-1121"></span><span class="hs-comment">--           class C a where</span><span>
</span><span id="line-1122"></span><span class="hs-comment">--             op :: a -&gt; a</span><span>
</span><span id="line-1123"></span><span class="hs-comment">--             default op :: Eq a =&gt; a -&gt; a</span><span>
</span><span id="line-1124"></span><span id="findDupSigs"><span class="annot"><span class="annottext">findDupSigs :: [LSig GhcPs] -&gt; [NonEmpty (Located RdrName, Sig GhcPs)]
</span><a href="GHC.Rename.Bind.html#findDupSigs"><span class="hs-identifier hs-var hs-var">findDupSigs</span></a></span></span><span> </span><span id="local-6989586621681133940"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133940"><span class="hs-identifier hs-var">sigs</span></a></span></span><span>
</span><span id="line-1125"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Located RdrName, Sig GhcPs)
 -&gt; (Located RdrName, Sig GhcPs) -&gt; Bool)
-&gt; [(Located RdrName, Sig GhcPs)]
-&gt; [NonEmpty (Located RdrName, Sig GhcPs)]
forall a. (a -&gt; a -&gt; Bool) -&gt; [a] -&gt; [NonEmpty a]
</span><a href="GHC.Data.List.SetOps.html#findDupsEq"><span class="hs-identifier hs-var">findDupsEq</span></a></span><span> </span><span class="annot"><span class="annottext">(Located RdrName, Sig GhcPs)
-&gt; (Located RdrName, Sig GhcPs) -&gt; Bool
forall {a} {l} {pass} {l} {pass}.
Eq a =&gt;
(GenLocated l a, Sig pass) -&gt; (GenLocated l a, Sig pass) -&gt; Bool
</span><a href="#local-6989586621681133939"><span class="hs-identifier hs-var">matching_sig</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LSig GhcPs -&gt; [(Located RdrName, Sig GhcPs)])
-&gt; [LSig GhcPs] -&gt; [(Located RdrName, Sig GhcPs)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig GhcPs -&gt; [(Located RdrName, Sig GhcPs)]
forall {pass}. Sig pass -&gt; [(Located (IdP pass), Sig pass)]
</span><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span class="annot"><span class="annottext">(Sig GhcPs -&gt; [(Located RdrName, Sig GhcPs)])
-&gt; (LSig GhcPs -&gt; Sig GhcPs)
-&gt; LSig GhcPs
-&gt; [(Located RdrName, Sig GhcPs)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcPs -&gt; Sig GhcPs
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133940"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1126"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1127"></span><span>    </span><span id="local-6989586621681133938"><span class="annot"><span class="annottext">expand_sig :: Sig pass -&gt; [(Located (IdP pass), Sig pass)]
</span><a href="#local-6989586621681133938"><span class="hs-identifier hs-var hs-var">expand_sig</span></a></span></span><span> </span><span id="local-6989586621681133937"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133937"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixitySig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133936"><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133936"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="annot"><span class="annottext">Fixity
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
-&gt; [Sig pass] -&gt; [(Located (IdP pass), Sig pass)]
forall a b. [a] -&gt; [b] -&gt; [(a, b)]
</span><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier hs-var">zip</span></a></span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133936"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig pass -&gt; [Sig pass]
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133937"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1128"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span id="local-6989586621681133934"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133934"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="annot"><span class="annottext">XInlineSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133933"><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133933"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133933"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133934"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1129"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span id="local-6989586621681133932"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133932"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="annot"><span class="annottext">XTypeSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133931"><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133931"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="annot"><span class="annottext">LHsSigWcType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133930"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133932"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681133930"><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133930"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133931"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1130"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span id="local-6989586621681133929"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133929"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133928"><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133928"><span class="hs-identifier hs-var">ns</span></a></span></span><span> </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133927"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133929"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681133927"><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133927"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133928"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1131"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span id="local-6989586621681133926"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133926"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133925"><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133925"><span class="hs-identifier hs-var">ns</span></a></span></span><span>  </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133924"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133926"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681133924"><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133924"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><a href="#local-6989586621681133925"><span class="hs-identifier hs-var">ns</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1132"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span id="local-6989586621681133923"><span class="annot"><span class="annottext">sig :: Sig pass
</span><a href="#local-6989586621681133923"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span> </span><span class="annot"><span class="annottext">XSCCFunSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SourceText
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133922"><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133922"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe (Located StringLiteral)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located (IdP pass)
</span><a href="#local-6989586621681133922"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133923"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-1133"></span><span>    </span><span class="annot"><a href="#local-6989586621681133938"><span class="hs-identifier hs-var">expand_sig</span></a></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1134"></span><span>
</span><span id="line-1135"></span><span>    </span><span id="local-6989586621681133939"><span class="annot"><span class="annottext">matching_sig :: (GenLocated l a, Sig pass) -&gt; (GenLocated l a, Sig pass) -&gt; Bool
</span><a href="#local-6989586621681133939"><span class="hs-identifier hs-var hs-var">matching_sig</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133919"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681133919"><span class="hs-identifier hs-var">n1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681133918"><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133918"><span class="hs-identifier hs-var">sig1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133917"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681133917"><span class="hs-identifier hs-var">n2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681133916"><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133916"><span class="hs-identifier hs-var">sig2</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681133919"><span class="hs-identifier hs-var">n1</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681133917"><span class="hs-identifier hs-var">n2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Sig pass -&gt; Sig pass -&gt; Bool
forall {pass} {pass}. Sig pass -&gt; Sig pass -&gt; Bool
</span><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133918"><span class="hs-identifier hs-var">sig1</span></a></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><a href="#local-6989586621681133916"><span class="hs-identifier hs-var">sig2</span></a></span><span>
</span><span id="line-1136"></span><span>    </span><span id="local-6989586621681133915"><span class="annot"><span class="annottext">mtch :: Sig pass -&gt; Sig pass -&gt; Bool
</span><a href="#local-6989586621681133915"><span class="hs-identifier hs-var hs-var">mtch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>           </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixSig"><span class="hs-identifier hs-type">FixSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1137"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#InlineSig"><span class="hs-identifier hs-type">InlineSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1138"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#TypeSig"><span class="hs-identifier hs-type">TypeSig</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1139"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133912"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133912"><span class="hs-identifier hs-var">d1</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ClassOpSig"><span class="hs-identifier hs-type">ClassOpSig</span></a></span><span> </span><span class="annot"><span class="annottext">XClassOpSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133911"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133911"><span class="hs-identifier hs-var">d2</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133912"><span class="hs-identifier hs-var">d1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133911"><span class="hs-identifier hs-var">d2</span></a></span><span>
</span><span id="line-1140"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>     </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynSig"><span class="hs-identifier hs-type">PatSynSig</span></a></span><span> </span><span class="annot"><span class="annottext">XPatSynSig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[Located (IdP pass)]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">LHsSigType pass
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1141"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SCCFunSig"><span class="hs-identifier hs-type">SCCFunSig</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1142"></span><span>    </span><span class="annot"><a href="#local-6989586621681133915"><span class="hs-identifier hs-var">mtch</span></a></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Sig pass
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1143"></span><span>
</span><span id="line-1144"></span><span class="hs-comment">-- Warn about multiple MINIMAL signatures</span><span>
</span><span id="line-1145"></span><span class="annot"><a href="GHC.Rename.Bind.html#checkDupMinimalSigs"><span class="hs-identifier hs-type">checkDupMinimalSigs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1146"></span><span id="checkDupMinimalSigs"><span class="annot"><span class="annottext">checkDupMinimalSigs :: [LSig GhcPs] -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#checkDupMinimalSigs"><span class="hs-identifier hs-var hs-var">checkDupMinimalSigs</span></a></span></span><span> </span><span id="local-6989586621681133910"><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133910"><span class="hs-identifier hs-var">sigs</span></a></span></span><span>
</span><span id="line-1147"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(LSig GhcPs -&gt; Bool) -&gt; [LSig GhcPs] -&gt; [LSig GhcPs]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcPs -&gt; Bool
forall name. LSig name -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isMinimalLSig"><span class="hs-identifier hs-var">isMinimalLSig</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133910"><span class="hs-identifier hs-var">sigs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1148"></span><span>      </span><span id="local-6989586621681133908"><span class="annot"><span class="annottext">minSigs :: [LSig GhcPs]
</span><a href="#local-6989586621681133908"><span class="hs-identifier hs-var">minSigs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><span class="annottext">LSig GhcPs
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">LSig GhcPs
</span><span class="hs-identifier">_</span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs] -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#dupMinimalSigErr"><span class="hs-identifier hs-var">dupMinimalSigErr</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133908"><span class="hs-identifier hs-var">minSigs</span></a></span><span>
</span><span id="line-1149"></span><span>      </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; TcRn ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1150"></span><span>
</span><span id="line-1151"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Match}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1158"></span><span>
</span><span id="line-1159"></span><span id="local-6989586621681134980"><span class="annot"><a href="GHC.Rename.Bind.html#rnMatchGroup"><span class="hs-identifier hs-type">rnMatchGroup</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134980"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1160"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134980"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134980"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1161"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134980"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1162"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MatchGroup"><span class="hs-identifier hs-type">MatchGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134980"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1163"></span><span id="rnMatchGroup"><span class="annot"><span class="annottext">rnMatchGroup :: forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; MatchGroup GhcPs (Located (body GhcPs))
-&gt; RnM (MatchGroup GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatchGroup"><span class="hs-identifier hs-var hs-var">rnMatchGroup</span></a></span></span><span> </span><span id="local-6989586621681133896"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133896"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133895"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133895"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#MG"><span class="hs-identifier hs-type">MG</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_alts :: forall p body. MatchGroup p body -&gt; Located [LMatch p body]
</span><a href="GHC.Hs.Expr.html#mg_alts"><span class="hs-identifier hs-var">mg_alts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133892"><span class="annot"><span class="annottext">[LMatch GhcPs (Located (body GhcPs))]
</span><a href="#local-6989586621681133892"><span class="hs-identifier hs-var">ms</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_origin :: forall p body. MatchGroup p body -&gt; Origin
</span><a href="GHC.Hs.Expr.html#mg_origin"><span class="hs-identifier hs-var">mg_origin</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681133890"><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681133890"><span class="hs-identifier hs-var">origin</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1164"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133889"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133889"><span class="hs-identifier hs-var">empty_case_ok</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#EmptyCase"><span class="hs-identifier hs-var">LangExt.EmptyCase</span></a></span><span>
</span><span id="line-1165"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LMatch GhcPs (Located (body GhcPs))] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcPs (Located (body GhcPs))]
</span><a href="#local-6989586621681133892"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133889"><span class="hs-identifier hs-var">empty_case_ok</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#emptyCaseErr"><span class="hs-identifier hs-var">emptyCaseErr</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133896"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1166"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681133886"><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681133886"><span class="hs-identifier hs-var">new_ms</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133885"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133885"><span class="hs-identifier hs-var">ms_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LMatch GhcPs (Located (body GhcPs))
 -&gt; RnM (LMatch GhcRn (Located (body GhcRn)), NameSet))
-&gt; [LMatch GhcPs (Located (body GhcPs))]
-&gt; RnM ([LMatch GhcRn (Located (body GhcRn))], NameSet)
forall a b. (a -&gt; RnM (b, NameSet)) -&gt; [a] -&gt; RnM ([b], NameSet)
</span><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier hs-var">mapFvRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LMatch GhcPs (Located (body GhcPs))
-&gt; RnM (LMatch GhcRn (Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LMatch GhcPs (Located (body GhcPs))
-&gt; RnM (LMatch GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatch"><span class="hs-identifier hs-var">rnMatch</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133896"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133895"><span class="hs-identifier hs-var">rnBody</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LMatch GhcPs (Located (body GhcPs))]
</span><a href="#local-6989586621681133892"><span class="hs-identifier hs-var">ms</span></a></span><span>
</span><span id="line-1167"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(MatchGroup GhcRn (Located (body GhcRn)), NameSet)
-&gt; RnM (MatchGroup GhcRn (Located (body GhcRn)), NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Origin
-&gt; [LMatch GhcRn (Located (body GhcRn))]
-&gt; MatchGroup GhcRn (Located (body GhcRn))
forall name (body :: * -&gt; *).
(XMG name (Located (body name)) ~ NoExtField) =&gt;
Origin
-&gt; [LMatch name (Located (body name))]
-&gt; MatchGroup name (Located (body name))
</span><a href="GHC.Hs.Utils.html#mkMatchGroup"><span class="hs-identifier hs-var">mkMatchGroup</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="#local-6989586621681133890"><span class="hs-identifier hs-var">origin</span></a></span><span> </span><span class="annot"><span class="annottext">[LMatch GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681133886"><span class="hs-identifier hs-var">new_ms</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133885"><span class="hs-identifier hs-var">ms_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1168"></span><span>
</span><span id="line-1169"></span><span id="local-6989586621681134843"><span class="annot"><a href="GHC.Rename.Bind.html#rnMatch"><span class="hs-identifier hs-type">rnMatch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1170"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1171"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1172"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LMatch"><span class="hs-identifier hs-type">LMatch</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134843"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1173"></span><span id="rnMatch"><span class="annot"><span class="annottext">rnMatch :: forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LMatch GhcPs (Located (body GhcPs))
-&gt; RnM (LMatch GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatch"><span class="hs-identifier hs-var hs-var">rnMatch</span></a></span></span><span> </span><span id="local-6989586621681133880"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133880"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133879"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133879"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Match GhcPs (Located (body GhcPs))
 -&gt; TcM (Match GhcRn (Located (body GhcRn)), NameSet))
-&gt; Located (Match GhcPs (Located (body GhcPs)))
-&gt; TcM (Located (Match GhcRn (Located (body GhcRn))), NameSet)
forall a b c. (a -&gt; TcM (b, c)) -&gt; Located a -&gt; TcM (Located b, c)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocFstM"><span class="hs-identifier hs-var">wrapLocFstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; Match GhcPs (Located (body GhcPs))
-&gt; TcM (Match GhcRn (Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; Match GhcPs (Located (body GhcPs))
-&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatch%27"><span class="hs-identifier hs-var">rnMatch'</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133880"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133879"><span class="hs-identifier hs-var">rnBody</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1174"></span><span>
</span><span id="line-1175"></span><span id="local-6989586621681134838"><span class="annot"><a href="GHC.Rename.Bind.html#rnMatch%27"><span class="hs-identifier hs-type">rnMatch'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134838"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1176"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134838"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134838"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1177"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134838"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1178"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134838"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1179"></span><span id="rnMatch%27"><span class="annot"><span class="annottext">rnMatch' :: forall (body :: * -&gt; *).
Outputable (body GhcPs) =&gt;
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; Match GhcPs (Located (body GhcPs))
-&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnMatch%27"><span class="hs-identifier hs-var hs-var">rnMatch'</span></a></span></span><span> </span><span id="local-6989586621681133874"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133874"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133873"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133873"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_ctxt :: forall p body. Match p body -&gt; HsMatchContext (NoGhcTc p)
</span><a href="GHC.Hs.Expr.html#m_ctxt"><span class="hs-identifier hs-var">m_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681133870"><span class="annot"><span class="annottext">HsMatchContext (NoGhcTc GhcPs)
</span><a href="#local-6989586621681133870"><span class="hs-identifier hs-var">mf</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_pats :: forall p body. Match p body -&gt; [LPat p]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681133868"><span class="annot"><span class="annottext">[LPat GhcPs]
</span><a href="#local-6989586621681133868"><span class="hs-identifier hs-var">pats</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: forall p body. Match p body -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681133866"><span class="annot"><span class="annottext">GRHSs GhcPs (Located (body GhcPs))
</span><a href="#local-6989586621681133866"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1180"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Note that there are no local fixity decls for matches</span><span>
</span><span id="line-1181"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; [LPat GhcPs]
-&gt; ([LPat GhcRn]
    -&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet))
-&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet)
forall a.
HsMatchContext GhcRn
-&gt; [LPat GhcPs]
-&gt; ([LPat GhcRn] -&gt; RnM (a, NameSet))
-&gt; RnM (a, NameSet)
</span><a href="GHC.Rename.Pat.html#rnPats"><span class="hs-identifier hs-var">rnPats</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133874"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">[LPat GhcPs]
</span><a href="#local-6989586621681133868"><span class="hs-identifier hs-var">pats</span></a></span><span>      </span><span class="annot"><span class="annottext">(([LPat GhcRn]
  -&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet))
 -&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet))
-&gt; ([LPat GhcRn]
    -&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet))
-&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681133864"><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681133864"><span class="hs-identifier hs-var">pats'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1182"></span><span>        </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681133863"><span class="annot"><span class="annottext">GRHSs GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681133863"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133862"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133862"><span class="hs-identifier hs-var">grhss_fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHSs GhcPs (Located (body GhcPs))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHSs GhcPs (Located (body GhcPs))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHSs"><span class="hs-identifier hs-var">rnGRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133874"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133873"><span class="hs-identifier hs-var">rnBody</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcPs (Located (body GhcPs))
</span><a href="#local-6989586621681133866"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-1183"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681133861"><span class="annot"><span class="annottext">mf' :: HsMatchContext GhcRn
</span><a href="#local-6989586621681133861"><span class="hs-identifier hs-var hs-var">mf'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133874"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcPs
HsMatchContext (NoGhcTc GhcPs)
</span><a href="#local-6989586621681133870"><span class="hs-identifier hs-var">mf</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1184"></span><span>                      </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#FunRhs"><span class="hs-identifier hs-type">FunRhs</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_fun :: forall p. HsMatchContext p -&gt; LIdP p
</span><a href="GHC.Hs.Expr.html#mc_fun"><span class="hs-identifier hs-var">mc_fun</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133858"><span class="annot"><span class="annottext">IdP GhcRn
</span><a href="#local-6989586621681133858"><span class="hs-identifier hs-var">funid</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#FunRhs"><span class="hs-identifier hs-type">FunRhs</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_fun :: forall p. HsMatchContext p -&gt; LIdP p
</span><a href="GHC.Hs.Expr.html#mc_fun"><span class="hs-identifier hs-var">mc_fun</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133857"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133857"><span class="hs-identifier hs-var">lf</span></a></span></span><span> </span><span class="annot"><span class="annottext">IdP GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1185"></span><span>                                            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcPs
HsMatchContext (NoGhcTc GhcPs)
</span><a href="#local-6989586621681133870"><span class="hs-identifier hs-var">mf</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mc_fun :: Located (IdP GhcRn)
</span><a href="GHC.Hs.Expr.html#mc_fun"><span class="hs-identifier hs-var">mc_fun</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133857"><span class="hs-identifier hs-var">lf</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP GhcRn
</span><a href="#local-6989586621681133858"><span class="hs-identifier hs-var">funid</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1186"></span><span>                      </span><span class="annot"><span class="annottext">(HsMatchContext GhcRn, HsMatchContext GhcPs)
</span><span class="hs-identifier">_</span></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133874"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-1187"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Match GhcRn (Located (body GhcRn)), NameSet)
-&gt; RnM (Match GhcRn (Located (body GhcRn)), NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Match :: forall p body.
XCMatch p body
-&gt; HsMatchContext (NoGhcTc p)
-&gt; [LPat p]
-&gt; GRHSs p body
-&gt; Match p body
</span><a href="GHC.Hs.Expr.html#Match"><span class="hs-identifier hs-type">Match</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">m_ext :: XCMatch GhcRn (Located (body GhcRn))
</span><a href="GHC.Hs.Expr.html#m_ext"><span class="hs-identifier hs-var">m_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XCMatch GhcRn (Located (body GhcRn))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_ctxt :: HsMatchContext (NoGhcTc GhcRn)
</span><a href="GHC.Hs.Expr.html#m_ctxt"><span class="hs-identifier hs-var">m_ctxt</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
HsMatchContext (NoGhcTc GhcRn)
</span><a href="#local-6989586621681133861"><span class="hs-identifier hs-var">mf'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_pats :: [LPat GhcRn]
</span><a href="GHC.Hs.Expr.html#m_pats"><span class="hs-identifier hs-var">m_pats</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LPat GhcRn]
</span><a href="#local-6989586621681133864"><span class="hs-identifier hs-var">pats'</span></a></span><span>
</span><span id="line-1188"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">m_grhss :: GRHSs GhcRn (Located (body GhcRn))
</span><a href="GHC.Hs.Expr.html#m_grhss"><span class="hs-identifier hs-var">m_grhss</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcRn (Located (body GhcRn))
</span><a href="#local-6989586621681133863"><span class="hs-identifier hs-var">grhss'</span></a></span><span class="hs-special">}</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133862"><span class="hs-identifier hs-var">grhss_fvs</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-1189"></span><span>
</span><span id="line-1190"></span><span class="annot"><a href="GHC.Rename.Bind.html#emptyCaseErr"><span class="hs-identifier hs-type">emptyCaseErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1191"></span><span id="emptyCaseErr"><span class="annot"><span class="annottext">emptyCaseErr :: HsMatchContext GhcRn -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#emptyCaseErr"><span class="hs-identifier hs-var hs-var">emptyCaseErr</span></a></span></span><span> </span><span id="local-6989586621681133855"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133855"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Empty list of alternatives in&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681133854"><span class="hs-identifier hs-var">pp_ctxt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1192"></span><span>                       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Use EmptyCase to allow this&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1193"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1194"></span><span>    </span><span id="local-6989586621681133854"><span class="annot"><span class="annottext">pp_ctxt :: MsgDoc
</span><a href="#local-6989586621681133854"><span class="hs-identifier hs-var hs-var">pp_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133855"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1195"></span><span>                </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="GHC.Hs.Expr.html#CaseAlt"><span class="hs-identifier hs-var">CaseAlt</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;case expression&quot;</span></span><span>
</span><span id="line-1196"></span><span>                </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="GHC.Hs.Expr.html#LambdaExpr"><span class="hs-identifier hs-var">LambdaExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;\\case expression&quot;</span></span><span>
</span><span id="line-1197"></span><span>                </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(unexpected)&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; MsgDoc
forall id. Outputable (IdP id) =&gt; HsMatchContext id -&gt; MsgDoc
</span><a href="GHC.Hs.Expr.html#pprMatchContextNoun"><span class="hs-identifier hs-var">pprMatchContextNoun</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133855"><span class="hs-identifier hs-var">ctxt</span></a></span><span>
</span><span id="line-1198"></span><span>
</span><span id="line-1199"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsubsection{Guarded right-hand sides (GRHSs)}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1206"></span><span>
</span><span id="line-1207"></span><span id="local-6989586621681134997"><span class="annot"><a href="GHC.Rename.Bind.html#rnGRHSs"><span class="hs-identifier hs-type">rnGRHSs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1208"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134997"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134997"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1209"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134997"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1210"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134997"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1211"></span><span id="rnGRHSs"><span class="annot"><span class="annottext">rnGRHSs :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHSs GhcPs (Located (body GhcPs))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHSs"><span class="hs-identifier hs-var hs-var">rnGRHSs</span></a></span></span><span> </span><span id="local-6989586621681133848"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133848"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133847"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133847"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-type">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHSs GhcPs (Located (body GhcPs))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133845"><span class="annot"><span class="annottext">[LGRHS GhcPs (Located (body GhcPs))]
</span><a href="#local-6989586621681133845"><span class="hs-identifier hs-var">grhss</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133844"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133844"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681133843"><span class="annot"><span class="annottext">HsLocalBinds GhcPs
</span><a href="#local-6989586621681133843"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1212"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcPs
-&gt; (HsLocalBinds GhcRn
    -&gt; NameSet -&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
forall result.
HsLocalBinds GhcPs
-&gt; (HsLocalBinds GhcRn -&gt; NameSet -&gt; RnM (result, NameSet))
-&gt; RnM (result, NameSet)
</span><a href="GHC.Rename.Bind.html#rnLocalBindsAndThen"><span class="hs-identifier hs-var">rnLocalBindsAndThen</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcPs
</span><a href="#local-6989586621681133843"><span class="hs-identifier hs-var">binds</span></a></span><span>   </span><span class="annot"><span class="annottext">((HsLocalBinds GhcRn
  -&gt; NameSet -&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet))
 -&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet))
-&gt; (HsLocalBinds GhcRn
    -&gt; NameSet -&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet))
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681133842"><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681133842"><span class="hs-identifier hs-var">binds'</span></a></span></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1213"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621681133841"><span class="annot"><span class="annottext">[LGRHS GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681133841"><span class="hs-identifier hs-var">grhss'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133840"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133840"><span class="hs-identifier hs-var">fvGRHSs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LGRHS GhcPs (Located (body GhcPs))
 -&gt; RnM (LGRHS GhcRn (Located (body GhcRn)), NameSet))
-&gt; [LGRHS GhcPs (Located (body GhcPs))]
-&gt; RnM ([LGRHS GhcRn (Located (body GhcRn))], NameSet)
forall a b. (a -&gt; RnM (b, NameSet)) -&gt; [a] -&gt; RnM ([b], NameSet)
</span><a href="GHC.Rename.Utils.html#mapFvRn"><span class="hs-identifier hs-var">mapFvRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LGRHS GhcPs (Located (body GhcPs))
-&gt; RnM (LGRHS GhcRn (Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LGRHS GhcPs (Located (body GhcPs))
-&gt; RnM (LGRHS GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHS"><span class="hs-identifier hs-var">rnGRHS</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133848"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133847"><span class="hs-identifier hs-var">rnBody</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcPs (Located (body GhcPs))]
</span><a href="#local-6989586621681133845"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-1214"></span><span>    </span><span class="annot"><span class="annottext">(GRHSs GhcRn (Located (body GhcRn)), NameSet)
-&gt; RnM (GRHSs GhcRn (Located (body GhcRn)), NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHSs GhcRn (Located (body GhcRn))
-&gt; [LGRHS GhcRn (Located (body GhcRn))]
-&gt; LHsLocalBinds GhcRn
-&gt; GRHSs GhcRn (Located (body GhcRn))
forall p body.
XCGRHSs p body -&gt; [LGRHS p body] -&gt; LHsLocalBinds p -&gt; GRHSs p body
</span><a href="GHC.Hs.Expr.html#GRHSs"><span class="hs-identifier hs-var">GRHSs</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCGRHSs GhcRn (Located (body GhcRn))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[LGRHS GhcRn (Located (body GhcRn))]
</span><a href="#local-6989586621681133841"><span class="hs-identifier hs-var">grhss'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsLocalBinds GhcRn -&gt; LHsLocalBinds GhcRn
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133844"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">HsLocalBinds GhcRn
</span><a href="#local-6989586621681133842"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133840"><span class="hs-identifier hs-var">fvGRHSs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1215"></span><span>
</span><span id="line-1216"></span><span id="local-6989586621681134820"><span class="annot"><a href="GHC.Rename.Bind.html#rnGRHS"><span class="hs-identifier hs-type">rnGRHS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1217"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134820"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134820"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1218"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LGRHS"><span class="hs-identifier hs-type">LGRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134820"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1219"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LGRHS"><span class="hs-identifier hs-type">LGRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134820"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1220"></span><span id="rnGRHS"><span class="annot"><span class="annottext">rnGRHS :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; LGRHS GhcPs (Located (body GhcPs))
-&gt; RnM (LGRHS GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHS"><span class="hs-identifier hs-var hs-var">rnGRHS</span></a></span></span><span> </span><span id="local-6989586621681133839"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133839"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133838"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133838"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GRHS GhcPs (Located (body GhcPs))
 -&gt; TcM (GRHS GhcRn (Located (body GhcRn)), NameSet))
-&gt; Located (GRHS GhcPs (Located (body GhcPs)))
-&gt; TcM (Located (GRHS GhcRn (Located (body GhcRn))), NameSet)
forall a b c. (a -&gt; TcM (b, c)) -&gt; Located a -&gt; TcM (Located b, c)
</span><a href="GHC.Tc.Utils.Monad.html#wrapLocFstM"><span class="hs-identifier hs-var">wrapLocFstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHS GhcPs (Located (body GhcPs))
-&gt; TcM (GRHS GhcRn (Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHS GhcPs (Located (body GhcPs))
-&gt; RnM (GRHS GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHS%27"><span class="hs-identifier hs-var">rnGRHS'</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133839"><span class="hs-identifier hs-var">ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133838"><span class="hs-identifier hs-var">rnBody</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1221"></span><span>
</span><span id="line-1222"></span><span id="local-6989586621681134814"><span class="annot"><a href="GHC.Rename.Bind.html#rnGRHS%27"><span class="hs-identifier hs-type">rnGRHS'</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsMatchContext"><span class="hs-identifier hs-type">HsMatchContext</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-1223"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134814"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134814"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1224"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134814"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1225"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681134814"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-1226"></span><span id="rnGRHS%27"><span class="annot"><span class="annottext">rnGRHS' :: forall (body :: * -&gt; *).
HsMatchContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; GRHS GhcPs (Located (body GhcPs))
-&gt; RnM (GRHS GhcRn (Located (body GhcRn)), NameSet)
</span><a href="GHC.Rename.Bind.html#rnGRHS%27"><span class="hs-identifier hs-var hs-var">rnGRHS'</span></a></span></span><span> </span><span id="local-6989586621681133827"><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133827"><span class="hs-identifier hs-var">ctxt</span></a></span></span><span> </span><span id="local-6989586621681133826"><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133826"><span class="hs-identifier hs-var">rnBody</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-type">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">XCGRHS GhcPs (Located (body GhcPs))
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133824"><span class="annot"><span class="annottext">[GuardLStmt GhcPs]
</span><a href="#local-6989586621681133824"><span class="hs-identifier hs-var">guards</span></a></span></span><span> </span><span id="local-6989586621681133823"><span class="annot"><span class="annottext">Located (body GhcPs)
</span><a href="#local-6989586621681133823"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1227"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681133822"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133822"><span class="hs-identifier hs-var">pattern_guards_allowed</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#PatternGuards"><span class="hs-identifier hs-var">LangExt.PatternGuards</span></a></span><span>
</span><span id="line-1228"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681133820"><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)]
</span><a href="#local-6989586621681133820"><span class="hs-identifier hs-var">guards'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133819"><span class="annot"><span class="annottext">Located (body GhcRn)
</span><a href="#local-6989586621681133819"><span class="hs-identifier hs-var">rhs'</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133818"><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133818"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsStmtContext GhcRn
-&gt; (LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet))
-&gt; [GuardLStmt GhcPs]
-&gt; ([Name] -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; RnM
     (([LStmt GhcRn (LHsExpr GhcRn)], Located (body GhcRn)), NameSet)
forall (body :: * -&gt; *) thing.
Outputable (body GhcPs) =&gt;
HsStmtContext GhcRn
-&gt; (Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; [LStmt GhcPs (Located (body GhcPs))]
-&gt; ([Name] -&gt; RnM (thing, NameSet))
-&gt; RnM (([LStmt GhcRn (Located (body GhcRn))], thing), NameSet)
</span><a href="GHC.Rename.Expr.html#rnStmts"><span class="hs-identifier hs-var">rnStmts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; HsStmtContext GhcRn
forall p. HsMatchContext p -&gt; HsStmtContext p
</span><a href="GHC.Hs.Expr.html#PatGuard"><span class="hs-identifier hs-var">PatGuard</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
</span><a href="#local-6989586621681133827"><span class="hs-identifier hs-var">ctxt</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr GhcRn, NameSet)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">[GuardLStmt GhcPs]
</span><a href="#local-6989586621681133824"><span class="hs-identifier hs-var">guards</span></a></span><span> </span><span class="annot"><span class="annottext">(([Name] -&gt; RnM (Located (body GhcRn), NameSet))
 -&gt; RnM
      (([LStmt GhcRn (LHsExpr GhcRn)], Located (body GhcRn)), NameSet))
-&gt; ([Name] -&gt; RnM (Located (body GhcRn), NameSet))
-&gt; RnM
     (([LStmt GhcRn (LHsExpr GhcRn)], Located (body GhcRn)), NameSet)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span class="annot"><span class="annottext">[Name]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1229"></span><span>                                    </span><span class="annot"><span class="annottext">Located (body GhcPs) -&gt; RnM (Located (body GhcRn), NameSet)
</span><a href="#local-6989586621681133826"><span class="hs-identifier hs-var">rnBody</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcPs)
</span><a href="#local-6989586621681133823"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-1230"></span><span>
</span><span id="line-1231"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; TcRn () -&gt; TcRn ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681133822"><span class="hs-identifier hs-var">pattern_guards_allowed</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)] -&gt; Bool
forall {l} {idL} {idR} {body}.
[GenLocated l (StmtLR idL idR body)] -&gt; Bool
</span><a href="#local-6989586621681133815"><span class="hs-identifier hs-var">is_standard_guard</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)]
</span><a href="#local-6989586621681133820"><span class="hs-identifier hs-var">guards'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1232"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarnReason -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addWarn"><span class="hs-identifier hs-var">addWarn</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)] -&gt; MsgDoc
forall body.
Outputable body =&gt;
[LStmtLR GhcRn GhcRn body] -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#nonStdGuardErr"><span class="hs-identifier hs-var">nonStdGuardErr</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)]
</span><a href="#local-6989586621681133820"><span class="hs-identifier hs-var">guards'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1233"></span><span>
</span><span id="line-1234"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(GRHS GhcRn (Located (body GhcRn)), NameSet)
-&gt; RnM (GRHS GhcRn (Located (body GhcRn)), NameSet)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XCGRHS GhcRn (Located (body GhcRn))
-&gt; [LStmt GhcRn (LHsExpr GhcRn)]
-&gt; Located (body GhcRn)
-&gt; GRHS GhcRn (Located (body GhcRn))
forall p body.
XCGRHS p body -&gt; [GuardLStmt p] -&gt; body -&gt; GRHS p body
</span><a href="GHC.Hs.Expr.html#GRHS"><span class="hs-identifier hs-var">GRHS</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XCGRHS GhcRn (Located (body GhcRn))
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmt GhcRn (LHsExpr GhcRn)]
</span><a href="#local-6989586621681133820"><span class="hs-identifier hs-var">guards'</span></a></span><span> </span><span class="annot"><span class="annottext">Located (body GhcRn)
</span><a href="#local-6989586621681133819"><span class="hs-identifier hs-var">rhs'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">NameSet
</span><a href="#local-6989586621681133818"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1235"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1236"></span><span>        </span><span class="hs-comment">-- Standard Haskell 1.4 guards are just a single boolean</span><span>
</span><span id="line-1237"></span><span>        </span><span class="hs-comment">-- expression, rather than a list of qualifiers as in the</span><span>
</span><span id="line-1238"></span><span>        </span><span class="hs-comment">-- Glasgow extension</span><span>
</span><span id="line-1239"></span><span>    </span><span id="local-6989586621681133815"><span class="annot"><span class="annottext">is_standard_guard :: [GenLocated l (StmtLR idL idR body)] -&gt; Bool
</span><a href="#local-6989586621681133815"><span class="hs-identifier hs-var hs-var">is_standard_guard</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1240"></span><span>    </span><span class="annot"><a href="#local-6989586621681133815"><span class="hs-identifier hs-var">is_standard_guard</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span class="annot"><span class="annottext">l
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#BodyStmt"><span class="hs-identifier hs-type">BodyStmt</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-1241"></span><span>    </span><span class="annot"><a href="#local-6989586621681133815"><span class="hs-identifier hs-var">is_standard_guard</span></a></span><span> </span><span class="annot"><span class="annottext">[GenLocated l (StmtLR idL idR body)]
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-1242"></span><span>
</span><span id="line-1243"></span><span class="hs-comment">{-
*********************************************************
*                                                       *
        Source-code fixity declarations
*                                                       *
*********************************************************
-}</span><span>
</span><span id="line-1250"></span><span>
</span><span id="line-1251"></span><span class="annot"><a href="GHC.Rename.Bind.html#rnSrcFixityDecl"><span class="hs-identifier hs-type">rnSrcFixityDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html#HsSigCtxt"><span class="hs-identifier hs-type">HsSigCtxt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1252"></span><span class="hs-comment">-- Rename a fixity decl, so we can put</span><span>
</span><span id="line-1253"></span><span class="hs-comment">-- the renamed decl in the renamed syntax tree</span><span>
</span><span id="line-1254"></span><span class="hs-comment">-- Errors if the thing being fixed is not defined locally.</span><span>
</span><span id="line-1255"></span><span id="rnSrcFixityDecl"><span class="annot"><span class="annottext">rnSrcFixityDecl :: HsSigCtxt -&gt; FixitySig GhcPs -&gt; RnM (FixitySig GhcRn)
</span><a href="GHC.Rename.Bind.html#rnSrcFixityDecl"><span class="hs-identifier hs-var hs-var">rnSrcFixityDecl</span></a></span></span><span> </span><span id="local-6989586621681133811"><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133811"><span class="hs-identifier hs-var">sig_ctxt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FixitySig GhcPs -&gt; RnM (FixitySig GhcRn)
</span><a href="#local-6989586621681133810"><span class="hs-identifier hs-var">rn_decl</span></a></span><span>
</span><span id="line-1256"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1257"></span><span>    </span><span class="annot"><a href="#local-6989586621681133810"><span class="hs-identifier hs-type">rn_decl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1258"></span><span>        </span><span class="hs-comment">-- GHC extension: look up both the tycon and data con</span><span>
</span><span id="line-1259"></span><span>        </span><span class="hs-comment">-- for con-like things; hence returning a list</span><span>
</span><span id="line-1260"></span><span>        </span><span class="hs-comment">-- If neither are in scope, report an error; otherwise</span><span>
</span><span id="line-1261"></span><span>        </span><span class="hs-comment">-- return a fixity sig for each (slightly odd)</span><span>
</span><span id="line-1262"></span><span>    </span><span id="local-6989586621681133810"><span class="annot"><span class="annottext">rn_decl :: FixitySig GhcPs -&gt; RnM (FixitySig GhcRn)
</span><a href="#local-6989586621681133810"><span class="hs-identifier hs-var hs-var">rn_decl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-type">FixitySig</span></a></span><span> </span><span class="annot"><span class="annottext">XFixitySig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681133809"><span class="annot"><span class="annottext">[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133809"><span class="hs-identifier hs-var">fnames</span></a></span></span><span> </span><span id="local-6989586621681133808"><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681133808"><span class="hs-identifier hs-var">fixity</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1263"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681133807"><span class="annot"><span class="annottext">[Located Name]
</span><a href="#local-6989586621681133807"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name])
-&gt; [Located RdrName]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m [b]) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#concatMapM"><span class="hs-identifier hs-var">concatMapM</span></a></span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
</span><a href="#local-6989586621681133805"><span class="hs-identifier hs-var">lookup_one</span></a></span><span> </span><span class="annot"><span class="annottext">[Located RdrName]
[Located (IdP GhcPs)]
</span><a href="#local-6989586621681133809"><span class="hs-identifier hs-var">fnames</span></a></span><span>
</span><span id="line-1264"></span><span>           </span><span class="annot"><span class="annottext">FixitySig GhcRn -&gt; RnM (FixitySig GhcRn)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XFixitySig GhcRn
-&gt; [Located (IdP GhcRn)] -&gt; Fixity -&gt; FixitySig GhcRn
forall pass.
XFixitySig pass -&gt; [Located (IdP pass)] -&gt; Fixity -&gt; FixitySig pass
</span><a href="GHC.Hs.Binds.html#FixitySig"><span class="hs-identifier hs-var">FixitySig</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XFixitySig GhcRn
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">[Located Name]
[Located (IdP GhcRn)]
</span><a href="#local-6989586621681133807"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="annot"><span class="annottext">Fixity
</span><a href="#local-6989586621681133808"><span class="hs-identifier hs-var">fixity</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1265"></span><span>
</span><span id="line-1266"></span><span>    </span><span class="annot"><a href="#local-6989586621681133805"><span class="hs-identifier hs-type">lookup_one</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1267"></span><span>    </span><span id="local-6989586621681133805"><span class="annot"><span class="annottext">lookup_one :: Located RdrName -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
</span><a href="#local-6989586621681133805"><span class="hs-identifier hs-var hs-var">lookup_one</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133804"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133804"><span class="hs-identifier hs-var">name_loc</span></a></span></span><span> </span><span id="local-6989586621681133803"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681133803"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1268"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall a. SrcSpan -&gt; TcRn a -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#setSrcSpan"><span class="hs-identifier hs-var">setSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133804"><span class="hs-identifier hs-var">name_loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1269"></span><span>                    </span><span class="hs-comment">-- This lookup will fail if the name is not defined in the</span><span>
</span><span id="line-1270"></span><span>                    </span><span class="hs-comment">-- same binding group as this fixity declaration.</span><span>
</span><span id="line-1271"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681133802"><span class="annot"><span class="annottext">[(RdrName, Name)]
</span><a href="#local-6989586621681133802"><span class="hs-identifier hs-var">names</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSigCtxt -&gt; MsgDoc -&gt; RdrName -&gt; RnM [(RdrName, Name)]
</span><a href="GHC.Rename.Env.html#lookupLocalTcNames"><span class="hs-identifier hs-var">lookupLocalTcNames</span></a></span><span> </span><span class="annot"><span class="annottext">HsSigCtxt
</span><a href="#local-6989586621681133811"><span class="hs-identifier hs-var">sig_ctxt</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681133800"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681133803"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-1272"></span><span>           </span><span class="annot"><span class="annottext">[Located Name] -&gt; IOEnv (Env TcGblEnv TcLclEnv) [Located Name]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; Located Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133804"><span class="hs-identifier hs-var">name_loc</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681133799"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133799"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681133799"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(RdrName, Name)]
</span><a href="#local-6989586621681133802"><span class="hs-identifier hs-var">names</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1273"></span><span>    </span><span id="local-6989586621681133800"><span class="annot"><span class="annottext">what :: MsgDoc
</span><a href="#local-6989586621681133800"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fixity signature&quot;</span></span><span>
</span><span id="line-1274"></span><span>
</span><span id="line-1275"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Error messages}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-1282"></span><span>
</span><span id="line-1283"></span><span class="annot"><a href="GHC.Rename.Bind.html#dupSigDeclErr"><span class="hs-identifier hs-type">dupSigDeclErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#NonEmpty"><span class="hs-identifier hs-type">NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1284"></span><span id="dupSigDeclErr"><span class="annot"><span class="annottext">dupSigDeclErr :: NonEmpty (Located RdrName, Sig GhcPs) -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#dupSigDeclErr"><span class="hs-identifier hs-var hs-var">dupSigDeclErr</span></a></span></span><span> </span><span id="local-6989586621681133798"><span class="annot"><span class="annottext">pairs :: NonEmpty (Located RdrName, Sig GhcPs)
</span><a href="#local-6989586621681133798"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133797"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133797"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681133796"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681133796"><span class="hs-identifier hs-var">name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681133795"><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133795"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3A%7C"><span class="hs-operator hs-type">:|</span></a></span><span> </span><span class="annot"><span class="annottext">[(Located RdrName, Sig GhcPs)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-1285"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133797"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1286"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Duplicate&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681133793"><span class="hs-identifier hs-var">what_it_is</span></a></span><span>
</span><span id="line-1287"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;s for&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681133796"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1288"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;at&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SrcSpan -&gt; MsgDoc) -&gt; [SrcSpan] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">([SrcSpan] -&gt; [MsgDoc]) -&gt; [SrcSpan] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; Ordering) -&gt; [SrcSpan] -&gt; [SrcSpan]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span>
</span><span id="line-1289"></span><span>                                       </span><span class="annot"><span class="annottext">([SrcSpan] -&gt; [SrcSpan]) -&gt; [SrcSpan] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((Located RdrName, Sig GhcPs) -&gt; SrcSpan)
-&gt; [(Located RdrName, Sig GhcPs)] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Located RdrName -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">(Located RdrName -&gt; SrcSpan)
-&gt; ((Located RdrName, Sig GhcPs) -&gt; Located RdrName)
-&gt; (Located RdrName, Sig GhcPs)
-&gt; SrcSpan
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Located RdrName, Sig GhcPs) -&gt; Located RdrName
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1290"></span><span>                                       </span><span class="annot"><span class="annottext">([(Located RdrName, Sig GhcPs)] -&gt; [SrcSpan])
-&gt; [(Located RdrName, Sig GhcPs)] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Located RdrName, Sig GhcPs)
-&gt; [(Located RdrName, Sig GhcPs)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#toList"><span class="hs-identifier hs-var">toList</span></a></span><span> </span><span class="annot"><span class="annottext">NonEmpty (Located RdrName, Sig GhcPs)
</span><a href="#local-6989586621681133798"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1291"></span><span>         </span><span class="hs-special">]</span><span>
</span><span id="line-1292"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1293"></span><span>    </span><span id="local-6989586621681133793"><span class="annot"><span class="annottext">what_it_is :: MsgDoc
</span><a href="#local-6989586621681133793"><span class="hs-identifier hs-var hs-var">what_it_is</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Sig GhcPs -&gt; MsgDoc
forall name. Sig name -&gt; MsgDoc
</span><a href="GHC.Hs.Binds.html#hsSigDoc"><span class="hs-identifier hs-var">hsSigDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133795"><span class="hs-identifier hs-var">sig</span></a></span><span>
</span><span id="line-1294"></span><span>
</span><span id="line-1295"></span><span class="annot"><a href="GHC.Rename.Bind.html#misplacedSigErr"><span class="hs-identifier hs-type">misplacedSigErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1296"></span><span id="misplacedSigErr"><span class="annot"><span class="annottext">misplacedSigErr :: LSig GhcRn -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#misplacedSigErr"><span class="hs-identifier hs-var hs-var">misplacedSigErr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133788"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133788"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681133787"><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681133787"><span class="hs-identifier hs-var">sig</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1297"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133788"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1298"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Misplaced&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn -&gt; MsgDoc
forall name. Sig name -&gt; MsgDoc
</span><a href="GHC.Hs.Binds.html#hsSigDoc"><span class="hs-identifier hs-var">hsSigDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681133787"><span class="hs-identifier hs-var">sig</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Sig GhcRn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcRn
</span><a href="#local-6989586621681133787"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1299"></span><span>
</span><span id="line-1300"></span><span class="annot"><a href="GHC.Rename.Bind.html#defaultSigErr"><span class="hs-identifier hs-type">defaultSigErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#Sig"><span class="hs-identifier hs-type">Sig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1301"></span><span id="defaultSigErr"><span class="annot"><span class="annottext">defaultSigErr :: Sig GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#defaultSigErr"><span class="hs-identifier hs-var hs-var">defaultSigErr</span></a></span></span><span> </span><span id="local-6989586621681133784"><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133784"><span class="hs-identifier hs-var">sig</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Unexpected default signature:&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1302"></span><span>                              </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Sig GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><a href="#local-6989586621681133784"><span class="hs-identifier hs-var">sig</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1303"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Use DefaultSignatures to enable default signatures&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1304"></span><span>
</span><span id="line-1305"></span><span class="annot"><a href="GHC.Rename.Bind.html#bindsInHsBootFile"><span class="hs-identifier hs-type">bindsInHsBootFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBindsLR"><span class="hs-identifier hs-type">LHsBindsLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1306"></span><span id="bindsInHsBootFile"><span class="annot"><span class="annottext">bindsInHsBootFile :: LHsBindsLR GhcRn GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#bindsInHsBootFile"><span class="hs-identifier hs-var hs-var">bindsInHsBootFile</span></a></span></span><span> </span><span id="local-6989586621681133783"><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681133783"><span class="hs-identifier hs-var">mbinds</span></a></span></span><span>
</span><span id="line-1307"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Bindings in hs-boot files are not allowed&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1308"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBindsLR GhcRn GhcPs
</span><a href="#local-6989586621681133783"><span class="hs-identifier hs-var">mbinds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1309"></span><span>
</span><span id="line-1310"></span><span id="local-6989586621681134800"><span class="annot"><a href="GHC.Rename.Bind.html#nonStdGuardErr"><span class="hs-identifier hs-type">nonStdGuardErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#Outputable"><span class="hs-identifier hs-type">Outputable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681134800"><span class="hs-identifier hs-type">body</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#LStmtLR"><span class="hs-identifier hs-type">LStmtLR</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681134800"><span class="hs-identifier hs-type">body</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span></span><span>
</span><span id="line-1311"></span><span id="nonStdGuardErr"><span class="annot"><span class="annottext">nonStdGuardErr :: forall body.
Outputable body =&gt;
[LStmtLR GhcRn GhcRn body] -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#nonStdGuardErr"><span class="hs-identifier hs-var hs-var">nonStdGuardErr</span></a></span></span><span> </span><span id="local-6989586621681133776"><span class="annot"><span class="annottext">[LStmtLR GhcRn GhcRn body]
</span><a href="#local-6989586621681133776"><span class="hs-identifier hs-var">guards</span></a></span></span><span>
</span><span id="line-1312"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;accepting non-standard pattern guards (use PatternGuards to suppress this message)&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1313"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LStmtLR GhcRn GhcRn body] -&gt; MsgDoc
forall a. Outputable a =&gt; [a] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#interpp%27SP"><span class="hs-identifier hs-var">interpp'SP</span></a></span><span> </span><span class="annot"><span class="annottext">[LStmtLR GhcRn GhcRn body]
</span><a href="#local-6989586621681133776"><span class="hs-identifier hs-var">guards</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1314"></span><span>
</span><span id="line-1315"></span><span class="annot"><a href="GHC.Rename.Bind.html#unusedPatBindWarn"><span class="hs-identifier hs-type">unusedPatBindWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsBind"><span class="hs-identifier hs-type">HsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-1316"></span><span id="unusedPatBindWarn"><span class="annot"><span class="annottext">unusedPatBindWarn :: HsBind GhcRn -&gt; MsgDoc
</span><a href="GHC.Rename.Bind.html#unusedPatBindWarn"><span class="hs-identifier hs-var hs-var">unusedPatBindWarn</span></a></span></span><span> </span><span id="local-6989586621681133774"><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681133774"><span class="hs-identifier hs-var">bind</span></a></span></span><span>
</span><span id="line-1317"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; Int -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This pattern-binding binds no variables:&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1318"></span><span>       </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBind GhcRn -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBind GhcRn
</span><a href="#local-6989586621681133774"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1319"></span><span>
</span><span id="line-1320"></span><span class="annot"><a href="GHC.Rename.Bind.html#dupMinimalSigErr"><span class="hs-identifier hs-type">dupMinimalSigErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#LSig"><span class="hs-identifier hs-type">LSig</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-1321"></span><span id="dupMinimalSigErr"><span class="annot"><span class="annottext">dupMinimalSigErr :: [LSig GhcPs] -&gt; TcRn ()
</span><a href="GHC.Rename.Bind.html#dupMinimalSigErr"><span class="hs-identifier hs-var hs-var">dupMinimalSigErr</span></a></span></span><span> </span><span id="local-6989586621681133773"><span class="annot"><span class="annottext">sigs :: [LSig GhcPs]
</span><a href="#local-6989586621681133773"><span class="hs-identifier hs-var">sigs</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681133772"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133772"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">Sig GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-1322"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErrAt"><span class="hs-identifier hs-var">addErrAt</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681133772"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; TcRn ()) -&gt; MsgDoc -&gt; TcRn ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1323"></span><span>    </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiple minimal complete definitions&quot;</span></span><span>
</span><span id="line-1324"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;at&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(SrcSpan -&gt; MsgDoc) -&gt; [SrcSpan] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">([SrcSpan] -&gt; [MsgDoc]) -&gt; [SrcSpan] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; Ordering) -&gt; [SrcSpan] -&gt; [SrcSpan]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span> </span><span class="annot"><span class="annottext">([SrcSpan] -&gt; [SrcSpan]) -&gt; [SrcSpan] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(LSig GhcPs -&gt; SrcSpan) -&gt; [LSig GhcPs] -&gt; [SrcSpan]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LSig GhcPs -&gt; SrcSpan
forall l e. GenLocated l e -&gt; l
</span><a href="GHC.Types.SrcLoc.html#getLoc"><span class="hs-identifier hs-var">getLoc</span></a></span><span> </span><span class="annot"><span class="annottext">[LSig GhcPs]
</span><a href="#local-6989586621681133773"><span class="hs-identifier hs-var">sigs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1325"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Combine alternative minimal complete definitions with `|'&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1326"></span><span class="annot"><a href="GHC.Rename.Bind.html#dupMinimalSigErr"><span class="hs-identifier hs-var">dupMinimalSigErr</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; TcRn ()
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dupMinimalSigErr&quot;</span></span><span>
</span><span id="line-1327"></span></pre></body></html>